hacer que la cabecera div se ajuste a la parte superior de la pantalla.
Publicado por ismael (4 intervenciones) el 12/02/2013 18:17:43
hola, mi problema es que no consigo hacer que la cabecera se pegue a la parte superior del monitor. Y no lo entiendo, porque en el body ya he solucionado el margin y el padding. Alguna idea. Mil gracias.
html:
css:
html:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dark and Sleek Web Design</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="contenido">
<div id="cabecera"></div>
<div id="menu"></div>
<div id="izquierda"></div>
<div id="derecha"></div>
</div>
</body>
</html>
css:
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
background-color:orange;/* Universal Selector margin/padding Reset */
* { margin:0; padding:0; }
body{
background-color:red;
}
#cabecera{
background-color:blue;
width:950px;
height:200px;
}
#menu{
background-color:orange;
width:950px;
height:30px;
}
#contenido{
background-color:blue;
width:950px;
height:900px;
margin: auto;
}
#izquierda{
background-color:orange;
width:650px;
height:900px;
float:left;
}
#derecha{
background-color:yellow;
width:300px;
height:900px;
margin-left:650px;
}
Valora esta pregunta
0