Browser does not open HTML with CSS

Asked

Viewed 42 times

-3

<html>
    <head>
    <style>
        body{
            margin: 0;
            padding: 0;
        }    
        #box1{
            height: 100vh;
            width: 100%;
            background-image: url(i1.jpg);
            background-size: cover;
            display: table;
            background-attachment: fixed;
        }
        #box2{
            height: 100vh;
            width: 100%;
            background-image: url(i2.jpg);
            background-size: cover;
            display: table;
            background-attachment: fixed;
        }
        #box3{
            height: 100vh;
            width: 100%;
            background-image: url(i3.jpg);
            background-size: cover;
            display: table;
            background-attachment: fixed;
        }
        h1{
            font-family: arial black;
            font-size: 50px;
            color:white;
            margin: 0px;
            text-align: center;
            display: table-cell;
            vertical-align: middle;
        }
    </style>
    </head>
    <body>
        <div id="box1">
            <h1>DAFT CREATION</h1>
        </div>
        <div id="box2">
            <h1>DAFT CREATION</h1>
        </div>
        <div id="box3">
            <h1>DAFT CREATION</h1>
        </div>
    </body>
</html>
  • And what happens in the browser?

  • How are you trying to access it? What’s popping up? Try accessing the console (most times F12 opens it) and see if any errors are returning.

  • simply nothing, the tab opens but becomes white screen, he knows that the content is there, because you can lower the screen, but nothing appears

  • In the console it says that it was an error while loading the image

  • Actually the real question is why he can’t load the images, I’m trying to do a PARALLAX effect

  • 1

    to downvoters I suggest to comment on why they did it, to downvote and not help the new user to see why their question was negative does not help at all

Show 1 more comment

2 answers

4

It’s because your H1 css contains the line: color:white.

So the text is white.

0

Hello, you set your H1 color to white in CSS. There’s nothing wrong when I run the page, the texts are displayed but if your background is also white you won’t be able to see at all.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.