[Solved] have an unordered list floated right, list items are backward

deronsizemore
avatar
rank Enthusiast

Enthusiast


Posts: 91
Joined: 2007-01-18

Hi - I've done some more work on the site I posted in my last post here. Now I've ran into another small problem that I can't seem to shake. I've got a nav menu (tabs) which I've floated right but since I've floated it right the list items are backward. The "HOME" tab is one the right instead of the left where I would expect it to be. I know it's because of the float: right, I just don't know how to change it. My nav menu's are normally on the left hand side so I've never encountered this before.

http://www.oxtalk.com/ksba

Thanks

Chris..S
Chris..S's picture
rank Moderator

Moderator


Posts: 5685
Joined: 2005-02-22

When you float something

When you float something right it goes as far right as it can. So the first one will go to the right hand edge. Then next one will abutt the left edge of that item - ie, source order will be right to left order, or to put it another way from left to right they will be in reverse order.

You can fix it by reversing the source order.

Ed Seedhouse
Ed Seedhouse's picture
rank Guru

Guru


Posts: 2610
Joined: 2005-12-14
Location: Victoria British Columbia

deronsizemore wrote:I've got

deronsizemore wrote:
I've got a nav menu (tabs) which I've floated right but since I've floated it right the list items are backward.

Which is how the CSS standard says it should be. Just as with a left float the first item in the list will float as far to the left as it possible, so with a float right the first item in the list must float to the right as far as possible.

I am not now, nor was I ever, any kind of "dude".

Ed Seedhouse

deronsizemore
deronsizemore's picture
rank Enthusiast

Enthusiast


Posts: 91
Joined: 2007-01-18

Thank you for the responses.

Thank you for the responses. I figured there was some easy CSS style I could throw in there to make the first list item appear back on the left. No big deal though, I will just reverse the HTML. Smiling

wolfcry911
wolfcry911's picture
rank Guru

Guru


Posts: 2834
Joined: 2004-09-01
Location: MA, USA

You could try floating the

You could try floating the li left (or display: inline) and the float the ul right

deronsizemore
deronsizemore's picture
rank Enthusiast

Enthusiast


Posts: 91
Joined: 2007-01-18

wolfcry911 wrote:You could

wolfcry911 wrote:
You could try floating the li left (or display: inline) and the float the ul right

I had tried originally floating the li left and the ul right (didn't work - it just places the nav back on the left hand side). I had not tried display: inline, but that also didn't work. I switched the HTML around around and it's fine.

I appreciate the help! Smiling

deronsizemore
deronsizemore's picture
rank Enthusiast

Enthusiast


Posts: 91
Joined: 2007-01-18

Wolfcry. After some code

Wolfcry. After some code tweaking, floating the url right and then floating the li left actually did work.

Thanks.