Click here to Skip to main content
15,897,371 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: A real CSS question! Pin
Randor 22-Jul-10 7:38
professional Randor 22-Jul-10 7:38 
AnswerRe: A real CSS question! [modified] Pin
Mustafa Ismail Mustafa21-Jul-10 22:15
Mustafa Ismail Mustafa21-Jul-10 22:15 
GeneralRe: A real CSS question! Pin
Randor 22-Jul-10 6:54
professional Randor 22-Jul-10 6:54 
AnswerRe: A real CSS question! Pin
Chris Maunder22-Jul-10 8:55
cofounderChris Maunder22-Jul-10 8:55 
GeneralRe: A real CSS question! [modified] Pin
Randor 22-Jul-10 9:56
professional Randor 22-Jul-10 9:56 
GeneralRe: A real CSS question! Pin
Chris Maunder22-Jul-10 10:07
cofounderChris Maunder22-Jul-10 10:07 
GeneralRe: A real CSS question! Pin
Randor 22-Jul-10 10:50
professional Randor 22-Jul-10 10:50 
GeneralRe: A real CSS question! Pin
Chris Maunder22-Jul-10 14:29
cofounderChris Maunder22-Jul-10 14:29 
Randor wrote:
Did you test this first?


You mean apart from including the live HTML in my message[^] so you could see it in action? I'm not sure what you mean.

One caveat, though: I enclosed the DIVs inside a larger, fixed height div for display purposes. The lower div then expands to fill the height of the surrounding container.

Now, if you want the 3 DIVs to be full browser height, and not just the full height of a containing HTML element, then the following will do it. And yes, I tested in IE8, FF3.6, Opera10, Chrome and Safari. Note the lack of XHTML doctype

HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<style>
body,html{ height:100%; padding:0;margin:0; } <!-- force viewport to be height of browser window -->
</style>
</style>
</head>

<body>

<div style="background-color:gray;height:100%">
<div style="height:100px;background-color:red;"> First row </div>
<div style="height:100px;background-color:green"> Second row </div> 
Final row
</div>

</body>

</html>

cheers,
Chris Maunder

The Code Project | Co-founder
Microsoft C++ MVP

QuestionI hope, I hope! Pin
Member 419459321-Jul-10 12:27
Member 419459321-Jul-10 12:27 
AnswerRe: I hope, I hope! Pin
Dalek Dave21-Jul-10 13:05
professionalDalek Dave21-Jul-10 13:05 
QuestionI hate CSS Pin
Christian Graus21-Jul-10 12:10
protectorChristian Graus21-Jul-10 12:10 
AnswerRe: I hate CSS Pin
Dalek Dave21-Jul-10 12:16
professionalDalek Dave21-Jul-10 12:16 
AnswerRe: I hate CSS Pin
Roger Wright21-Jul-10 19:07
professionalRoger Wright21-Jul-10 19:07 
GeneralRe: I hate CSS Pin
Christian Graus22-Jul-10 12:54
protectorChristian Graus22-Jul-10 12:54 
AnswerRe: I hate CSS Pin
Chris Maunder22-Jul-10 8:57
cofounderChris Maunder22-Jul-10 8:57 
GeneralRe: I hate CSS Pin
LunaticFringe29-Jul-10 8:33
LunaticFringe29-Jul-10 8:33 
QuestionSerious CSS Question Pin
Dalek Dave21-Jul-10 11:57
professionalDalek Dave21-Jul-10 11:57 
AnswerRe: Serious CSS Question Pin
DaveAuld21-Jul-10 12:07
professionalDaveAuld21-Jul-10 12:07 
GeneralRe: Serious CSS Question Pin
AspDotNetDev21-Jul-10 14:30
protectorAspDotNetDev21-Jul-10 14:30 
AnswerRe: Serious CSS Question Pin
jeron121-Jul-10 12:13
jeron121-Jul-10 12:13 
GeneralRe: Serious CSS Question Pin
Mustafa Ismail Mustafa21-Jul-10 22:04
Mustafa Ismail Mustafa21-Jul-10 22:04 
AnswerRe: Serious CSS Question Pin
RichardM121-Jul-10 17:36
RichardM121-Jul-10 17:36 
AnswerRe: Serious CSS Question Pin
Roger Wright21-Jul-10 19:15
professionalRoger Wright21-Jul-10 19:15 
QuestionWow. A forum dedicated to slagging him off Pin
Pete O'Hanlon21-Jul-10 11:27
mvePete O'Hanlon21-Jul-10 11:27 
AnswerRe: Wow. A forum dedicated to slagging him off Pin
LunaticFringe21-Jul-10 11:37
LunaticFringe21-Jul-10 11:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.