Melika Barzegaran
Melika Barzegaran

Reputation: 439

Why background image doesn't show up?

I have this code in html and css. the problem is that the background image doesn't show up. first I thought the problem is with the size of the image and I made it smaller. but it made no change. can anyone help spotting the problem?

<!DOCTYPE html>
<html>
    <head>
        <link rel="shortcut icon" href="favicon.ico">
        <style>
            {background-image:url('background.png');}
        </style>
    </head>
    <title>
        Melika Barzegaran Hosseini - Home Page
    </title>
</html>

Upvotes: 1

Views: 2331

Answers (1)

SW4
SW4

Reputation: 71140

Maybe change your CSS to:

body{background-image:url('background.png');}

At present you have no CSS selector in place to identify exactly 'what' to apply the background image to.

Failing that, ensure that the image is actually found at the location specified.

Upvotes: 5

Related Questions