Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do I align lists side by side equally accross the page

Featured Replies

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 by deb0and

CSS

 

li {
display: inline;
}

 

Try that, is that what you're looking for?

Edited by Samus

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:

SDl4U.jpg

Edited by WebSetGo

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.