Repeat the background image both horizontally and vertically with CSS


Use the background-image property to repeat an image both horizontally and vertically. You can try to run the following code to repeat the background image

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         body {
            background-image: url("https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg");
         }
      </style>
   </head>
   <body>
      <h1>Background Image</h1>
   </body>
</html>

Updated on: 30-Jun-2020

109 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements