Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

split div in two taking all available vertical space

Tags:

html

css

I'm trying to split a div in two side by side divs. I know that has several examples here, but I already searched and not found one that permit that the divs take all available space in vertical, without any content.

Take a look http://jsfiddle.net/kpDDM/3/

like image 699
Ronaldo Avatar asked Dec 21 '22 18:12

Ronaldo


1 Answers

To set a percentage height to your divs, their parent element must have a specific height. In this case it appears you want it based on the viewport height. To achieve this, every ancestor div must have a height of 100%:

*, html, body, .parent {
    height: 100%;
}

JS Fiddle: http://jsfiddle.net/kpDDM/6/

like image 109
JSW189 Avatar answered Jan 07 '23 16:01

JSW189