problem with repeating css graphic

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

body{background-image:url('images/bggreen.jpg');}


This is created in a css page and is linked to a page. It displays it in
the page I want it to. The problem is I do not want to image to repeat.

The code below works on a single page. The problem seems to be trying to
get the image not to repeat and get the color to continue on the page on the
css page that I am linking it to. The image displays but it repeats. It
seems like I am missing some type of configuration. Any help would be
appreciated.

<style type="text/css">
body {background: #EFEFEF url(images/bggreen.jpg) repeat-x;}
</style>
 
Hi Mark,
There's 4 options for repeat
repeat-x - repeats across the page (but not down)
repeat-y - repeats down the page (but not across)
repeat - tiles to fill the page
no-repeat - shows the image once.

Sounds like you should be using no-repeat rather than repeat-x. This will
show the image once in the top left - if you want it somewhere else you can
set it's position.

Cheers,
Jon
 
I've tried all four and was not successful with any of these. It works if I
put it on the same page but when I put the information below in my css page
and then link it I get the graphic but it repeats. Below is what I put in.
I substituted repeat-x for any of the other three. the graphic starts out
green and then fades to a light gray so I want the light gray to continue
for the duration of the page


body{background-image:url('images/bggreen.jpg');} repeat-x;)

or repeat -
 
disregard it. I think I finally got it to work.

Mark said:
I've tried all four and was not successful with any of these. It works if
I put it on the same page but when I put the information below in my css
page and then link it I get the graphic but it repeats. Below is what I
put in. I substituted repeat-x for any of the other three. the graphic
starts out green and then fades to a light gray so I want the light gray
to continue for the duration of the page


body{background-image:url('images/bggreen.jpg');} repeat-x;)

or repeat -
 
Back
Top