Forums

[resolved] Full pad of div with a floated div inside (3 posts)

  1. Madcore
    Member
    Posted 4 years ago #

    Hi folks.

    In my design, I have a main div, with a content div and a sidebar div, and below the main div, the footer div. In the code, that´s look like that:

    <div id="mainframe">
    <div id="content">something here</div>
    <div id="sidebar">something there</div>
    </div>
    <div id="footer">and also, something here</div>

    I tried to float the sidebar to right, and to position to absolute it, in the css, but the footer div outside the mainframe shows below the content div when the sidebar div has a bigger height than the content.

    I want to pad the mainframe div to the same height of the sidebar div when it height is bigger than the content, to make the footer shown directly below the mainframe div and the sidebar div, instead below the content.

    How can I make it trought the CSS?

  2. Cephus
    Member
    Posted 4 years ago #

    Is the sidebar floated or absolute? If it's absolute, that's your problem. And absolute placed div will not take up space in your container (main) div.

    Absolutely can be controlled if they are placed within a relative placed div. Is your main div relative?

  3. Madcore
    Member
    Posted 4 years ago #

    Thanks for the reply, Cephus.

    I finally fix that by myself. The sidebar wasn´t absolute, but floated.

    I fixed the problem with the footer with the "clear: both;" css.

    Anyway, thanks for your reply.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.