Align 3 divs in a single row. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Align 3 divs in a single row.

how can i align 3 divs in a single horizontal row with equal width and height?

5th Feb 2017, 5:21 AM
Hassan Ejaz
Hassan Ejaz - avatar
2 Answers
+ 5
Don't use 'float', use <table> behaviour: #my3divs { display:table; table-layout:fixed; border-spacing:5px; width:100%; } .my3cells { display:table-cell; width:33.33%; } <div id="my3divs"> <div class="my3cells"> <!-- ... --> </div> <div class="my3cells"> <!-- ... --> </div> <div class="my3cells"> <!-- ... --> </div> </div> Another ways are to done it with 'Flex' ( not able to explain, except give link to references )... or to use possibily of auto-column text in css: https://code.sololearn.com/WbCU8pf68o08/#css
5th Feb 2017, 7:52 AM
visph
visph - avatar
0
thanks buddy
5th Feb 2017, 2:30 PM
Hassan Ejaz
Hassan Ejaz - avatar