
Posicionamiento divs
Publicado por Tomas (34 intervenciones) el 06/09/2015 20:36:15
Buenas, llevo dandole vueltas y no lo consigo, quiero que el div central ocupe lo que queda de pantalla. Se encuentra entre el footer y el header. Contiene 3 elementos mucho mas pequeños que el. En este caso lo que sucede es que ocupa más espacio de la pantalla (deja un espacio en blanco grande debajo de los 3 elementos).
Tengo body y html con height 100%, margin 0px
HTML
CSS
Tengo body y html con height 100%, margin 0px
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
27
28
29
30
31
32
33
34
35
<body>
<header id="header-principal">
<div id="logo">
<a href="index.html"><img src="logo.png" ></img></a>
</div>
</header>
<div id="main">
<section class="texto">
<header><h2>titulo1</h2></header>
<article>
<p>texto1</p>
<p>texto1.1</p>
</article >
</section>
<section class="texto">
<header><h2>titulo2</h2></header>
<article>
<p>texto2</p>
</article>
</section>
<section class="texto">
<header><h2>titulo3</h2></header>
<article>
<p>texto3</p>
<p>texto3.1</p>
</article>
</section>
</div>
<footer>
<p>texto footer</p>
</footer>
</body>
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
.texto{
display:inline-block;
margin-left:12%;
margin-top:5%;
margin-bottom:5%;
}
#main{
height:100%;
with:100%;
}
#header-principal{
margin:auto;
width:100%;
height:100px;
max-height:120px;
background: green url('fondo.png') repeat;
position:static;
display:inline-block;}
footer{
margin:0px;
position:static;
width:100%;
height:100px;
text-align:center;
text-align:center;
background: #1C1C1C url('fondo.png') repeat;
}
footer p {
position:relative;
padding: 2em 0em;
}
Valora esta pregunta


0