-2
I am creating this site but at first I have a problem. I defined an image as background and now the Divs background does not appear. When it is a static background appears normal, but with background image the div background does not appear. someone can explain to me what the problem is?
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="box">
</div>
</body>
</html>
CSS:
*{
border: none;
background-image: url('brackground.jpg');
background-repeat: no-repeat;
margin: 0 auto;
background-attachment: fixed;
background-position: center;
background-size: cover;
}
.box
width: 500px;
height: 500px;
background-color: #fff;
}
if this CSS is copied and pasted from what you have, it is missing to open a key after
.box
.– jsbueno
.box
 width: 500px;
 height: 500px;
 background-color: #fff;
}
after the.box
missing a{
– dippas
I fixed it but the box still won’t show.
– Peterson Alves