Background Image Repeat?


I am trying to add a repeating background, using the following code:


However it also shows once, it does not repear vertically.

Do I need to do anything else, is this Javascript or simply CSS?

it’s css.
you’ve done it right.

no idea why it doesn’t work.

There is not enough code presented to know what you are doing. CSS affects other CSS and as well as the markup.

For what it’s worth, what you have posted is right. You may also write it shorthand:
background:url(‘images/menuground.png’) repeat-y;

Here are some things that may be tripping you up:

  1. you may have the repeat declaration set for none somewhere else in the code and it’s overwriting the intended rule. Think ‘specificity’ not just code order.

div .target {background-repeat:none;}
.target {background-repeat:repeat-y;} /within ANY div class taget5 will not have a repeating b/g/

OR, you element may have collapsed so it’s not showing the repetition. This is specially likely if you have floated it’s content or given it’s children position:absolute.