0

I'm trying to have two divs above and below each other, both of which take up 50% of the screen.

My site is here and the divs in question are #intro and #services. Any idea what I'm doing wrong?

Sebastian
  • 3,548
  • 18
  • 60
  • 95
  • 1
    Add `html,body{height:100%;}` – j08691 Jun 06 '14 at 16:35
  • Argh, I knew I forgot something! That did it. Thanks. – Sebastian Jun 06 '14 at 16:36
  • Note: All parent elements of the elements `#intro` and `#services` has to have the height set to work. – Protomen Jun 06 '14 at 16:39
  • @GuilhermeNascimento - No, not all parents, just at least one. But in this case since we're dealing with the height of the viewport and percentages, only the html and body elements must have a height set. – j08691 Jun 06 '14 at 16:48
  • @j08691 Ranges from "webbrowser" (engine, eg. Gecko, Trident, Webkit, etc) to "webbrowser" and "doctype" to "doctype". > Note: this question is a duplicate and has been asked numerous times. – Protomen Jun 06 '14 at 16:52

1 Answers1

2

Add html,body{height:100%;} to your code.

j08691
  • 204,283
  • 31
  • 260
  • 272