body { font-family: Arial, sans-serif; padding: 0; margin: 0; color: #222222; } header { background: url(../img/first-bg.jpg) no-repeat center top / cover); height: 100vh; } 
 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Golden</title> <link rel="stylesheet" href="css/main.css"> </head> <body> <header> <div class="container"> </div> </header> <section> <div class="container"> <footer> <div class="container"> </div> </footer> <body> </html> 

The picture is not displayed I can not understand why I downloaded the finished work, everything works there! I still have the same but the picture is not displayed why?

  • And you think that adding a code here without the picture itself, will it work with us miraculously? - Cheg

1 answer 1

Extra bracket in the background :

 body { font-family: Arial, sans-serif; padding: 0; margin: 0; color: #222222; } header { background: url(http://lorempixel.com/400/200/) no-repeat center top / cover; height: 100vh; } 
 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Golden</title> <link rel="stylesheet" href="css/main.css"> </head> <body> <header> <div class="container"> </div> </header> <section> <div class="container"> <footer> <div class="container"> </div> </footer> <body> </html> 

  • Thanks god and I spent about an hour to solve the problem: D - On1x_Pavlovich
  • @ On1x_Pavlovich if the answer helped - then mark it. - newman