Align <li> in center? SOLVED

This is a discussion on "Align <li> in center? SOLVED" within the Web Page Design section. This forum, and the thread "Align <li> in center? SOLVED are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Feb 18th, 2008, 19:49
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,405
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Align <li> in center? SOLVED

I have this navigation:
Code: Select all
<div id="navigation">
<ul>
<li><a href="/">Home</a></li>
<li><a href="submit.php">Submit</a></li>
<li><a href="news.php">News</a></li>
<li><a href="siteofmonthaward.php">Site of the Month</a></li>
<li><a href="mostviewed.php">Most Viewed</a></li>
<li><a href="toprated.php">Top Rated</a></li>
</ul>
</div>
And the CSS:
Code: Select all
#navigation {
width: 950px;
height: 60px;
margin: 0;
padding: 0;
text-align: center;
}
#navigation ul {
list-style: none;
margin: 0;
padding: 0;
text-align: center;
}
#navigation ul li {
float: left; */Placed there for IE7*/
}
#navigation ul li a {
float: left;
margin: 0 0 0 20px;
padding: 7px;
border: 3px solid black;
border-top: none;
}
But whatever I try, I cannot get the ul or li's to display in the center! Anyone got a solution?

Thanks,

Jack
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Feb 18th, 2008, 20:10
Reputable Member
Join Date: Sep 2007
Location: Tehran - Iran
Age: 29
Posts: 434
Blog Entries: 2
Thanks: 7
Thanked 7 Times in 7 Posts
Re: Align <li> in center?

Are you sure ?
I can see them in center of your 950px width navigation !
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Feb 18th, 2008, 20:12
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,405
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: Align <li> in center?

Is it something to do with the float: left?

Anyway, yes I am Absolutely positive. In IE & FF. It's aligned left. It makes no sense!
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Feb 18th, 2008, 20:13
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,405
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: Align <li> in center?

Did it. Gave the <ul> a width and added margin: 0 auto.

SOLVED.
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Feb 18th, 2008, 20:14
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Align <li> in center?

Not sure if this is what you are after but if you change your width to 650px in your #navigation that should centre it on the page.

Pat
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
div align problem vobla Web Page Design 10 Apr 8th, 2008 09:52
[SOLVED] background img center in table robertl Web Page Design 9 Oct 1st, 2007 05:27
center align text/background image Lchad Web Page Design 5 Dec 5th, 2006 10:40
align background DrRedSkwirrell Web Page Design 8 Oct 10th, 2005 20:03
help with text-align: center iemerick Web Page Design 1 Jun 9th, 2005 18:05


All times are GMT. The time now is 18:09.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42