I want to put an image inside a div that occupies a whole body, that when you increase the screen with the mouse scroll, it continues to follow the size of the whole screen. Example site with background like this: link When you enlarge the screen with the mouse scroll, the blue background follows the size of the screen. I believe it is within the same div, with the exact size, but follow the body with the width. I already tried to do inside the div: width: max-body;
width: 1000%; (It was the worst of all, had to put all the data to the left and according to the roll of the screen with the mouse, an hour would not give.)
Who can help, thank you. Simple question, though, is important, as I can access something from the body inside the div and so on. If it can do with javascript, it serves as well. HTML, CSS or Javascript. Thanks
<style>
body {
margin: auto;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
div#cabecario {
min-height:1780px;
width: 1000px;
position:relative;
}
div#fundo {
background-color:#C0C0C0;
text-align: center;
background-image: url("../imagem/logo1.jpg");
background-size: 100%100%;
background-repeat: no-repeat;
height: 15%;
width: 100%;
background-color: black;
position: absolute;
top:3%;
}
</style>
<html>
<body>
//Aqui não tem nada
<div id="cabecario">
//Aqui também não tem nada
<div id="fundo">
//Aqui é somente para deixar a imagem no início do cabeçário, que começa no top 0%.
</div>
// Aqui vem as outras informações, como aside, p, textos, imagens, etc
</div>
//Aqui fecha o cabeçário
</body>
//Fechou o body
</html>
Currently, my code is like this. I used some codes that answered below but did not fix it. Thanks to those who help