1

I want to make a full height website but it seem twitter make issue with body min-height 100%

here my css :

html{
    height:100%;
}
body{
    min-height:100%
}
#main{
    min-height:100%;
}

and here my HTML :

<html>
    <head>
        ...
    </head>
    <body>
        <div id="main" class="container">
            ...
        </div>
    </body>
</html>

I want my #main div always same height that browser if content is smaller than browser but I want my div will highter than browser if my content is bigger.

With my code, #main div always take height of my content and don't adjust to my browser size if i have a small content.

Why ?!

Fabien
  • 548
  • 7
  • 18

3 Answers3

0

Try giving this CSS.

body, html {
  height: 100%;
  min-height: 100%;
}
#main {
  min-height:100%;
}
Tushar
  • 4,280
  • 5
  • 24
  • 39
0

You need to add some extra css to your code.

#main {
min-height:100%;
}

body, html {
height: 100%;
min-height: 100%;
}

i hope this is what you're looking for if, not try explain me what happens ;)!

user3261123
  • 79
  • 2
  • 7
  • If I fix my body height to 100%, my content overflows of my body when content is long. I want my body have at least the same height that browser but un unlimited height if my content is to long – Fabien Mar 03 '14 at 14:35
0

Just add below CSS and you will be done :

body, html {
  padding:0px;
  margin:0px;
  height: 100%;
  min-height: 100%;
}
Sushil Kandola
  • 870
  • 2
  • 9
  • 22