So, you basically want a table layout? This is one of the nastiest things in CSS. You might consider to fall back to old fashioned HTML tables, but if you don't care about IE6/7 support, then you can also play around using display
attributes of table
, table-row
and eventually table-cell
.
Here's an SSCCE, copy'n'paste'n'run it.
<!DOCTYPE html>
<html lang="en">
<head>
<title>SO question 3323454</title>
<style>
html {
height: 100%;
}
body {
display: table;
margin: 0;
width: 100%;
height: 100%;
}
#large_div {
display: table-row;
width: 100%;
height: 100%;
background: pink;
}
</style>
</head>
<body>
<h2>Title</h2>
<div id="large_div">blah.. blah.. blah..</div>
</body>
</html>
Again, this works in decent CSS2-adhering browsers only.
If all you want to achieve is to give the div a nice background, then there are nicer solutions.