/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Centering list menu

Hey people

Ive created a list menu floating the list items to the left and i can’t get them to centre. I have tried text-align center on the containing div but to no avail.

this is the page:
[url]http://www.ls12style.co.uk/projects/PHLG/[/url]

i want the navigation to be centered.

This is the css:

[CODE]#navigation ul {
padding:0;
margin:0 auto;
list-style-type:none;
}

#navigation ul li{
float:left;
width:100px;
text-align:center;
}

#navigation ul li a{
display:block;
text-decoration:none;
color:#009900;
}

#navigation ul li a:hover{
background-color:#00CC00;
color:#FFFFFF;
}[/CODE]

Thanks

TehAshMan

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscAug 25.2008 — put a width of 159px (instead of 100) on your li (or 20% if you want to do it in % instead of px)
Copy linkTweet thisAlerts:
@CentauriAug 25.2008 — [CODE]#navigation ul {
padding:[COLOR="Red"]0 0 0 150px[/COLOR];
margin:[COLOR="Red"]0[/COLOR];
list-style-type:none;
}[/CODE]
×

Success!

Help @tehashman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...