WordPress.org

Forums

CSS border bottom putting it at the top (3 posts)

  1. davehprohoods
    Member
    Posted 1 year ago #

    We have a style in our theme stylesheet that was border-top: 2px blue solid; and I changed it to border-bottom but it still showed at the top and the div was collapsed even though everything inside it should have expanded it. Here's an example:

    <div style="border-top: 2px blue solid">
        <a style="float: left" href="/blah"><img src="/blah/image.png">Blah</a>
        <div style="margin: 0px; padding: 10px; float: left; width: 320px">
            <a href="/some other link">Some Other Link</a>
            <p style="height: 36px; overflow: hidden; line-height: 16px; padding-top: 5px">Tips on Stuff.</p>
        </div>
    </div>

    I had a hard time finding a good CSS forum, so can anyone advise on this and recommend a good forum?

  2. Andrew
    Forum moderator
    Posted 1 year ago #

    We need to see the page in question to help with this.

  3. davehprohoods
    Member
    Posted 1 year ago #

    After reading some more about CSS, I think I figured this out, though CSS is not that intuitive to me. I think it is because the two divs inside are floated, which means the encapsulating div has no determined height before the border is drawn, so it is actually at the bottom, but the bottom edge of the div is at the top.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.