Log in

View Full Version : Background wont display



fodo
11-28-2008, 05:33 PM
I am just starting a site that needs a backgound image.
Currently I cant get it to display.
test site link http://217.46.159.226/shc/
The mark up is


<?php



require ('shc_fns.php');
do_html_header();

?>
<link href="./includes/layout.css" media="screen"
rel="stylesheet" type="text/css" />
</head>
<body>
<div id="maincontainer">
<div id="contentwrapper">
<p class="p">mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm</p>
<div class="innertube"><p>Spam spam spam spam spam spam
spam spam spam spam spam spam
spam spam spam spam spam spam
spam spam spam spam spam spam.</p>
<p>Spam spam spam spam spam spam
spam spam spam spam spam spam
spam spam spam spam spam spam
spam spam spam spam spam spam.</p>
</div>
</div>
</div>

</body>
</html>
The css so far is
body{
margin: 0;
padding: 0;
line-height: 1em;
background: #6EC6F1;
text-align: center;
}
#maincontainer{
width: 900px;
margin: 0 auto;
padding-top: 5px;
}
#contentwrapper{
float: left;
width: 100%;
background-image: url('/images/backgroundx900.jpg');
background-repeat: no-repeat;
width: 900px;
height: 500px;
}
.p{
color:red;
}

bluewalrus
11-28-2008, 05:39 PM
Try background: url('/images/backgroundx900.jpg');
instead of
background-image: url('/images/backgroundx900.jpg');

Link supplied doesn't work.

fodo
11-28-2008, 05:46 PM
sorry. link will work now

thetestingsite
11-28-2008, 05:48 PM
the image you are trying to load as the background:

http://217.46.159.226/images/backgroundx900.jpg

cannot be found on the server. Make sure you entered the filename correctly or that the image is in fact uploaded to the correct spot.

Hope this helps.

fodo
11-28-2008, 05:53 PM
the image is in http:217.46.159.226/shc/images/
Is my ref path wrong?

thetestingsite
11-28-2008, 05:55 PM
yes. Instead of using the following:



background-image: url('/images/backgroundx900.jpg');


use this instead:



background: url('images/backgroundx900.jpg');


Hope this helps.

bluewalrus
11-28-2008, 05:56 PM
testsite already said it haha

fodo
11-28-2008, 05:59 PM
Ok thanks everyone. Now works with full path ref. http etc
I will try the alts mentioned also