SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast mr_innovate's Avatar
    Join Date
    Dec 2001
    Location
    On My PC
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Strange alignment issue occurred on WordPress

    All of the stories on the home page now appear below the widgets/side-menu, for example scroll down on Latest Gadgets - Gadget Reviews, Gizmos & Tech News also if you click through to a story it's also appearing below the right-hand bar, rather than next to it, example: Olympus gets tough with its latest camera

    What's strange is that the site was working fine for over 6 months and suddenly something has caused this issue - probably a plugin update or one of the ad units. However, I've gone through the code and CSS can't spot anything obvious - I wondered if anyone here could spot a cause in the code?

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,344
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    I didn't see the issue you were mentioning. What browser is this happening in?

    I do see that your #feature div is 40px too big do the space it sits in. The available space is only 940px wide but the feature element is 940px wide + 40px padding making it too big to fit.
    Code:
    #feature {
      background: none repeat scroll 0 0 #2B2727;
      float: left;
      margin: 0 0 15px -20px;
      padding: 0 40px 0 0;
      position: relative;
      width: 940px;
    }
    You've made it fit in some browsers by hacking with a negative margin but that still leaves it broken in IE6.

    You could probably offset the width by using another negative margin on the right side as well to soak up the extra width.

    Code:
    #feature {
      background: none repeat scroll 0 0 #2B2727;
      float: left;
      margin: 0 -40px 15px -20px;
      padding: 0 40px 0 0;
      position: relative;
      width: 940px;
    }
    Generally elements must fit in their allocated space.

  3. #3
    SitePoint Enthusiast mr_innovate's Avatar
    Join Date
    Dec 2001
    Location
    On My PC
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's very, very strange - as by magic it's come back to normal alignment. I guess this must be caused by a rogue advertising unit!? Frustratingly I disable all the ads during my troubleshooting but the problem still remained, but as you say, today it looks fine. I can't work out what on earth caused it.

    Thanks for letting me know about the features block

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,344
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    ok just give us a shout if it goes awry 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
  •