• Resolved madcore

    (@madcore)


    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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?

    Thread Starter madcore

    (@madcore)

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Full pad of div with a floated div inside’ is closed to new replies.