Height 100% in the content

1

Hello, I'm having a height problem follow the code the world below for better understanding:

HTML:

<html>
<body>
    <div class='wrapper'>
            <div class='cabecalho'></div>
            <div class='conteudo'>
                Conteúdo
        </div>
            <div class='clear'></div>
            <div class='rodape'></div>
    </div>
</body>

CSS

html,body{
   height:100%;
}
body{
   background:lightgray;
}
.wrapper{
   height:auto;
   width:100%;
   min-height:100%;
   position:relative;
   overflow:hidden;
}
.cabecalho{
   height:50px;
   background:orange;
   width:100%;
}
.conteudo{
   padding-bottom:100px;
}
.clear{
   clear:both;
}
.rodape{
   width:100%;
   position:absolute;
   bottom:0;
   height:40px;
   background:green;
}

Fiddle in example: link

With this code the footer is at the bottom of the page if you have very little content, and also if you have a lot of content.

The problem is that I am now using a framework that is injecting into the .content a <div style='height:100%'></div> and in all its parents (wrapper, body, html) is putting in style height: 100%.

1 - Then there is the need for the .content to always have the height 100% (minus the footer part) regardless of the text inside.

How it works: Howitshouldbe:

2 - If you have a lot of text / image and it exceeds the size of the window the footer should go to the bottom of the page (as it is currently).

3 - Also has a menu that I did not put in but it opens on the content side and should have the same height as the content.

4 - Everything should be compatible with IE8 + (so flexbox, height: calc can not be used).

Thanks for the help!

    
asked by anonymous 27.05.2015 / 21:24

1 answer

1

The problem is that you are using 2 properties relative to height in your wrapper div. Removing the min-height:100%; property and adding height:100% to your content, everything works fine.

Here is an example of the working code: link

I hope I have helped.

    
03.06.2015 / 02:48