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.

Help needed in centering rounded buttons

Featured Replies

Hi

 

I have five nav rounded buttons that I cant get to centre on the site. . .Can anyone help?

 

Thanks

 

Kate

 

 

html is:

 

<div id="navigation">
<ul>
<li><a href="index.html" title="Structural steel for builders">Home</a></li>
<li><a href="products.html" title="A comprehensive service for steel">Products></a></li>
<li><a href="delivery.html" title="A map of where we deliver to roughly">Delivery Area</a></li>
<li><a href="location.html" title="How to find us">Our Location</a></li>
<li><a href="contact.html" title="How to get in contact with us">Contact</a></li>
</ul>
</div>

css is:

#navigation ul{
list-style: none; 
margin: 0px; 
padding: 0px;
text-align: center;		
}


#navigation li{
background: url(images/buttons.jpg) left no-repeat;
		overflow: hidden;
		height: 22px;
		width: 178px;
		padding-left: 10px;
		margin-right: 5px;
		float: left;
		text-align: center;
}

#navigation li a{
background: url(images/buttons.jpg) right no-repeat;
		display: block;
		padding: 2px 10px 1px 0px;
		height: 19px;
		color: #fff;
		text-decoration: none;	
}

#navigation a:link {
color:	#fff;
text-decoration:	none;
}

#navigation a:visited {
color:	#cc3333;
text-decoration:	none;
}

#navigation a:hover {
color:	#FFCC33;
text-decoration:	none;
}

Edited by Sam G
added [code] tags

You have five buttons each 178px + 10 + 5 = 193px x 5 = total 965px.

 

Edit the ul style:-

#navigation ul{ width: 965px; 
list-style: none;
margin: 0 auto; /*was 0px;*/
padding: 0px;
text-align: center;
}

  • Author

You have five buttons each 178px + 10 + 5 = 193px x 5 = total 965px.

 

Edit the ul style:-

#navigation ul{ width: 965px; 
list-style: none;
margin: 0 auto; /*was 0px;*/
padding: 0px;
text-align: center;
}

 

Thank you so much - works perfectly!!

 

Not Grumpykate now!!

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.