How to add background image in Html and Css

Hello friends, today we will see you in this blog you'll learn How to add background image in Html and Css codes for website| HTML Website Tutorials indicoderz .Earlier I have shared a blog on How to add background image in Html and Css codes for website| HTML Website Tutorials indicoderz Generally. 

Youtube Tutorial of HTML code for add background image 


Html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Background image</title>
  
  <link rel="stylesheet" href="style.css">
</head>

<body>

</body>
</html>

Css


body {
  background-image: url("img.jpg");
  height:100vh;
  background-size: cover;
  background: center;
}



Post a Comment

Previous Post Next Post