PDA

View Full Version : Background Image Trouble


Lingman
05-30-2010, 07:53 PM
Hi all,

I'm a DW newbie. So sorry for the stupid question:

I am trying to put a uniform repeating image in my new template and have utilized the Page Properties feature at the bottom of Dreamweaver CS5; however, when I do it, it appears that the image was only put into the header. How do I apply my repeating image to the entire page?

here is the entire code:


<html>
<head>
<style type="text/css">
body
{
background-image: url(../../../Documents/19original.jpg);
background-repeat: repeat-x;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>

<body>
<h1>Hello World!</h1>
</body>

</html>


Any ideas? Thanks.

Corrosive
05-31-2010, 05:46 AM
That code looks correct to me.

gentleone
05-31-2010, 06:03 AM
Make from 'repeat-x' just 'repeat'. 'x' will repeat only on the 'x' axis thus horizontally and that's why it's only behind your header.


body
{
background-image: url(../../../Documents/19original.jpg);
background-repeat: repeat;
}

Corrosive
05-31-2010, 06:15 AM
Well spotted dude :)

gentleone
05-31-2010, 06:16 AM
Well spotted dude :)

I was surprised myself on this early Monday morning :)

Lingman
05-31-2010, 10:55 AM
Thanks guys!

d a v e
05-31-2010, 12:35 PM
in fact isn't the default repeat anyway so you don't even need to specify it, if you don't want ;)

gentleone
05-31-2010, 01:18 PM
in fact isn't the default repeat anyway so you don't even need to specify it, if you don't want ;)

And again I was thinking of that too, Dave :) but I was not sure if 'repeat' is the background-repeat default for every browser. It can do no harm to put it there unless Lingman is picky on the amount of code than he has to dive into code view and write the 'background' shorthand version :)

body {background: url(../../../Documents/19original.jpg) repeat}