SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS Float makes things backwards with W3Schools example

    Hello all, this question refers to:

    http://www.w3schools.com/css/tryit.a...=trycss_float5

    I tried to change a {float: right} to put the menu on the right, but then the links go in backward order in which they are written (ie, Link4 Link3 Link2 Link1). I would like them to be aligned to the right of the page but still in the right order! Anyone know what the problem is and how to fix it? I would appreciate it!

    Thanks!

  2. #2
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Plano
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you do a {float:right}, then the first link will be against the right border, the second link will be against the first link, etc. to get the effect you want, you will want to keep float:left on anchor's, and make an exterior container that will be floated to the right

  3. #3
    SitePoint Addict CaryD's Avatar
    Join Date
    Nov 2006
    Location
    San Diego, CA
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't float li to the right. You want to float ul to the right.

  4. #4
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot! That worked perfectly.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •