How can we put background image in html? how does background image works in html?can i get any sample code to execute?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
putting background image in html is a basic thing and here is the code to put background image in html.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>Background Image Example</title>
<style>
body {
background-image: url(‘https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRRBUydQONe0F9SEbxr3F0f-5fKmEPnX0iNJQ&s’);
background-size: cover;
background-position: center; /* Center the background image */
background-repeat: no-repeat; }
</style>
</head>
</html>