0

Can someone explain me this, why it doesn't show image? Note: If i remove <!DOCTYPE html> it will show image.

<!DOCTYPE html>
<head>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <section class="header">
        <div class="box">
        </div>
    </section>
</body>
</html>

CSS

.box
{
    background-image: url(background1.jpeg);
    width: 100%;
    height: 100%;
}
  • width and height set 'px' – vadivel a Feb 21 '20 at 12:56
  • 1
    `height:100%` means the height of the parent, which is undefined in standards mode. In quirks mode, the body is as high as the viewport. To solve this, explicitly set the height of `body` in your css, e.g. to `100vh`. – Mr Lister Feb 21 '20 at 12:58

0 Answers0