clock  Mon - Sun 8.00 AM - 8.00 PM
mail  edu@teknowize.com
fb
instagram
play store
pinterest

More

CSS Background Image

Imperial Advance Hero Image

CSS Background Image

  • It is use to add image in back ground.
  • In this if we use any images then it repeat vertically and horizontally until full screen is covered, so there are some tag, which fix this problem.

 

Syntax -

background-image:url('image file path');

 

For example -

<!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.0">
  <title>Teknowize</title>

  <style>
    .BgImageCls{
     width: 100%;
     height: 100vh;
      background-image: url('teknowize.png');
    }
  </style>

</head>

<body>

  <div class="BgImageCls">
    <h1>CSS Background Image</h1>
    <p>Welcome to Teknowize</p>
  </div>

</body> 

</html> 

  

 

Output

CSS

CSS