Computer Science, asked by sea17, 1 month ago

how to apply a background in html?

Answers

Answered by pranavarak88
1

The most common & simple way to add background image is using the background image attribute inside the <body> tag. The background attribute which we specified in the <body> tag is not supported in HTML5. Using CSS properties, we can also add background image in a webpage.

Answered by Sniki
1

Answer:

To add a background image:

Use the HTML style attribute and the CSS background-image property:

Example:

<div style="background-image: URL('img_girl.jpg');">

To add background colour:

Use the HTML style attribute

Example:

<!DOCTYPE html>

<html>

<body style=" background-colour:powder blue;">

<h1>This is a heading</h1>

<p>This is a paragraph.</p>

</body>

</html>

Similar questions