Om te beginnen: schrijf je html code zo correct mogelijk...
met doctype definitie, html-tag, head-tag, body-tag.
alle tags weer afsluiten (zoals je <p> )
ik zie geen html en body -tag dus deze css regel doet het niet:
html,body {height:100%;margin:0;padding:0}
wat leidt tot het niet doen van
#container, #container p {height:100%;}
de onderstaande code zal het moeten doen...
succes!!!
HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type='text/css'>
html,body {height:100%;margin:0;padding:0}
#container {background:red}
#container p {margin:0;padding:0;background:#eee;line-height:6em;text-align:center;}
#container {
height:100%;
}
#container p {
height:100%;
}
</style>
</head>
<body>
<div id='container'>
<p>Ik wil geen rood op deze pagina!</p>
</div>
</body>
</html> |