0

index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Masterlink International</title>
</head>
<link href="frontpage.css" rel="stylesheet" type="style/css" />



<div id="body">
<body>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris consectetur nunc quis orci feugiat a semper lectus interdum. Aliquam ipsum metus, mollis sed commodo nec, blandit nec tortor. Nulla eget massa sem. Nullam cursus libero eu massa consectetur et fringilla lectus sodales. Ut tempor, eros vel consequat convallis, erat nulla convallis ipsum, id rutrum ipsum ante eget leo. Vivamus hendrerit auctor tortor ut dapibus. In nec lorem diam, hendrerit pretium diam. Nulla varius porta congue. 
</body>

</div>

</html>

Hey, I wonder why background's image does not appears


frontpage.css

@charset "utf-8";
/* CSS Document */

body {
	background-image: url(Background.jpg);
}

The link is correct but I cannot see my background image in IE. I can see it in my Dreamweaver.

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by geneh23
0

you should not add div tag before body tag

<div id="body">
<body>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris consectetur nunc quis orci feugiat a semper lectus interdum. Aliquam ipsum metus, mollis sed commodo nec, blandit nec tortor. Nulla eget massa sem. Nullam cursus libero eu massa consectetur et fringilla lectus sodales. Ut tempor, eros vel consequat convallis, erat nulla convallis ipsum, id rutrum ipsum ante eget leo. Vivamus hendrerit auctor tortor ut dapibus. In nec lorem diam, hendrerit pretium diam. Nulla varius porta congue.
</body>
 
</div>

Just remove the div it should work, if it did not work try the following css, but you should remove div tag before body

body
{
 background: url(background.jpg)
}

Edited by carrieathomer: n/a

0

The CSS should be:

body {
 background: url("background.jpg");
}

I've put a semi-colon and double quotes.

0

It only works when I place this in the same file:

<style type="text/css">
body {
	background: url("Background.jpg");
}
</style>

It does not work when I write it in frontpage.css

Why is it?

0

try placing your images in an images folder and executing your code as follows:

background-image: url(../Images/sample.jpeg);

let me know if that helps!

This topic has been dead for over six months. 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.