Forums

Second loop inheriting css of first loop (5 posts)

  1. BStock1983
    Member
    Posted 2 years ago #

    I'm running into two problems on my site, but I think they're related. I've got a page that I'm trying to run two loops on.

    Both loops are set up to only display one post from one unique category. That part is working just fine.

    The issue is with the CSS. The second loop is displaying the same css as the first loop even though it's nested in a different div that has different styling assigned. When I look at it in firebug, it looks as though it's inside of div class="posts", even though on my specials.php page it's clearly inside of div id="body".

    If I take the loop off the template and just insert static text in the div it appears exactly how I want it to, but as soon as the loop is put in it seems to pick up the .posts styling again.

    I'm working on it live at http://www.manayunktavern.com. If anyone knows why it would be doing this it would be so helpful. Thanks so much for taking the time to look through this, I'm not sure where I'm going wrong.

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    Run your problem pages through a XHTML validator, i'd wager it's an invalid tag or nesting issue..

    Validator will be quicker then scouring the code line by line manually.. ;)

    To save you more time, here's a link for one..
    http://validator.w3.org/

  3. BStock1983
    Member
    Posted 2 years ago #

    Thanks for the help! I did run it through a validator and the only error that came up was that an alt was missing for an image. I do think you're right, though, that it must be some div that isn't closed out, but I haven't found any yet...

  4. BStock1983
    Member
    Posted 2 years ago #

    I found the problem! Somehow some code was accidentally pasted inside the second loop that was causing it to inherit the styling for the posts class. Thanks so much for your help t31os_! Having someone else's opinion definitely helped push me in the right direction.

  5. Mark / t31os
    Moderator
    Posted 2 years ago #

    Happy to help.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic