Ryan Moore wrote:
Looking to Center Text on an unordered list.
css:
ul
{text-align: center;}
li
{
display: inline;
list-style-type: none;
padding-right: 20px;
}
markup:
ul
lia href=#Item one/a/li
lia href=#Item two/a/li
lia href=#Item three/a/li
lia href=#Item four/a/li
lia href=#Item
yes it's good, i like the float:left better than display:inline.
On 7/25/07, Ryan Lin [EMAIL PROTECTED] wrote:
Hi there,
ul { display:block; width:100%; text-align:center; list-style:none}
ul li {float:left; margin-right:5px}
These two styles should get you this.
Did I do it correct?
Hi there,
ul { display:block; width:100%; text-align:center; list-style:none}
ul li {float:left; margin-right:5px}
These two styles should get you this.
Did I do it correct? Comments?
Ryan Moore wrote:
Looking to Center Text on an unordered list.
Example:
ul
liLink 1/li
liLink 2/li
liLink
Looking to Center Text on an unordered list.
Example:
ul
liLink 1/li
liLink 2/li
liLink 3/li
/li
Desired Effect:
Link 1 Link 2 Link 3
I don't have my CSS Code Base with me right now so hopefully someone can
lend a hand.
***
I think the easiest way I can think of is this:
ul {
display: block;
width:100%;
text-align:center;
}
li {
display:inline;
font-weight:bold;
}
On 7/25/07, Ryan Moore [EMAIL PROTECTED] wrote:
Looking to Center Text on an unordered list.
Example:
ul
liLink 1/li
liLink 2/li
Hey Taco
The only problem with your method is that you have to set the left right
positions to a fixed value (10%). I think setting margins on the body
(margin-left: 10%; margin-right: 10%;)would work in a similar way.
In some cases you don't care what the left right margins look like you
The first example you gave is designed to work for any situation. It works
for items that have fixed widths or liquid widths (based on the width of the
viewport). And yes, it is not as elegant as it should be.
However, if you have a liquid layout, there is a much simpler method that
only needs
The first one is better as you are not taking the box out of the flow of
the page. Using top and left with absolute positioning will do this...
For example if you had a fixed block to align center, then doing the
margins with top and left is difficult as you don't know the width of
the
Title: Message
Just been reading
about center align, and its problems
The recommendation
is
margin-left: auto;margin-right:
auto;width: 80%;text-align: left;
and a
hack
body { text-align:
center; }
I have always been
using
left:
10%;right: 10%;width: 80%;text-align:
left;
Which