3
How should I proceed so that my <div id="rosa">
occupies the entire available area even when the window is resized and not a specified height?
html,
body {
margin: 0;
padding: 0;
}
header {
width: 100%;
background: yellow;
position: fixed;
top: 0;
height: 100px;
z-index: 100;
}
#corpo {
position: relative;
min-height: 100%;
/* Sizing - any length */
padding: 100px 0 30px 0;
/* Header height and footer height */
margin: 0 auto 0 auto;
/* Center corpo */
}
#menu {
background: red;
width: 200px;
top: 100px;
bottom: 20px;
left: 0;
position: fixed;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
#conteudo {
background: green;
margin-left: 200px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
#campos {
height: 80px;
background-color: blue;
}
#rosa {
background-color: pink;
height: 400px;
}
footer {
background: yellow;
width: 100%;
position: fixed;
bottom: 0;
height: 20px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>teste</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!-- Always on top: Position Fixed-->
<header>
header
</header>
<!-- Fixed size after header-->
<div id="corpo">
<!-- Always on top. Fixed position, fixed width, relative to corpo width-->
<div id="menu">
menu-left
</div>
<!-- conteudo div with main corpo -->
<div id="conteudo">
<div id="campos"></div>
<div id="rosa">
a
</div>
</div>
</div>
<!-- Always at the end of the page -->
<footer>
footer
</footer>
</body>
</html>
It depends. Do you want the whole page to be static? Does your content all go in pink div? There should be a scroll?
– Leon Freire
My content goes in pink div with scroll if necessary. Thanks for the layout.
– Alaercio Mazutti
You want some responsiveness?
– Leon Freire
At first no.
– Alaercio Mazutti