November 18, 201115 yr Hello, I am struggling to get my 3 lists aligned equally accross the page. I have created a class(square) and then wrapped each ul in a div, however this is not giving me my desired results. here is my css code #container { margin: 0 auto; width: 750px; background:#fff; } #footer { background:#white; text-align: center; padding: 20px; height: 1%; } .square { float:left; width:210px; margin: 0 10px 10px 30px; } the html that corresponds to the lists is below also <div class="square"> <ul> <li>1</li> <li>1</li> <li>1</li> <li>1</li> <li>1</li> </ul> <img src= "download_button.gif" /> </div> <div class="square"> <ul> <li>1</li> <li>1</li> <li>1</li> <li>1</li> <li>1</li> </ul> <img src= "download_button.gif" /> </div> <div class="square"> <ul> <li>1</li> <li>1</li> <li>1</li> <li>1</li> <li>1</li> </ul> <img src= "download_button.gif" /> </div> Edited November 18, 201115 yr by deb0and
November 18, 201115 yr CSS li { display: inline; } Try that, is that what you're looking for? Edited November 18, 201115 yr by Samus
November 19, 201115 yr I did this recently using floats. Float one list left, one right, and don't float the final, instead, set it's margin like this margin: auto auto; as long as there is enough room in their container (width-wise) they will all sit side by side and will take up all the space in the container when you add width: 30%; to them all. If you have padding etc on them you will need to reduce the percentage to ensure they will fit. result: Edited November 19, 201115 yr by WebSetGo
Create an account or sign in to comment