SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2013
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why is the sidebar in the middle of the page?

    URL: http://goo.gl/ORsbhS

    I'm not sure what in the world I did to this, but on pages with no content, the sidebar is now in the middle of the page instead of staying on the right. I've looked and looked and don't see my mistake. Do you see it?

    (It wasn't like this yesterday, so I know I did something to mess things up.)

  2. #2
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,195
    Mentioned
    71 Post(s)
    Tagged
    3 Thread(s)
    I would guess you have a </div> in the wrong place.

    Looking at your source code using HTML Tidy in firefox it says you have duplicate div ID's. If a div is to be used more than once it should be a class not an ID.

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,825
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Hi,

    Try adding clear:right to the sidebar as its snagging when there is no other content.

    Code:
    .sidebar-primary {
        clear: right;
    }

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2013
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many thanks for both of you for taking a look. I'm not sure what I did to cause the problem, but clear: right; fixes it. Thank you, again.


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
  •