-1

Hi, I am trying to add backgroung-image to body of a webpage. Its working on inline way but noy through css. I tried everything even searched on google. But I don't want where I am making mistake.

<!doctype HTML>
<html>
<head>
<title>Buttons</title>
<link rel = "stylesheet" type = "text/css" href = "assets/stylesheet.css" />
</head>

<body>

</body>
</html>

And here is CSS:

body {
    background-image: url("images/p3.jpg");
}

I also tried:

    body {
        background: url(images/p3.jpg);
    }

But not working!

3
Contributors
4
Replies
30
Views
2 Months
Discussion Span
Last Post by gentlemedia
1

I asume your CSS is in that stylesheet.css, so then your path to that image should be like this.

body {
    background-image: url("../images/p3.jpg");
}
0

This code is working!

    body {
        background-image: url("../images/p3.jpg");
    }

What was the problem on that codes which I sent? Can you tell me @gentlemedia.

Edited by peace_coder

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.