FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

centering links in ul li

 


yo.hassan
Is it possible to centering objects or links horizontally using <ul><li> i tried but it gets aligned to the left. Using padding-left works but when add link again, i need to re adjust the padding-left value. Hope theres some way to do that. Thanks
The World is Yours
You could try:

Code:

text-align: center;
display: inline;


Last edited by The World is Yours on Tue Aug 21, 2007 6:59 am; edited 1 time in total
minik
...or you could try
Code:
<center>your text</center>


It would probably be easier.
mathiaus
W3schools wrote:
The center element was deprecated in HTML 4.01.
The center element is not supported in XHTML 1.0 Strict DTD.
Fuzzy-Duck
Hi hassan,

I'd recommend against using display:inline as below as that could give unexpected results!

The World is Yours wrote:
You could try:

Code:

text-align: center;
display: inline;


Instead how about...

Code:
ul {
  margin: 0 auto;
  padding-left: whatever-you-want;
}

li {
  margin: 0;
  width: 100%;
  text-align: center;
}


Hope this helps,

Cheers,
fuzzy
maeglin20
Thanks this Helps..
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.