Jump to content

Same Background Applied To Multiple Divs


brunocbreis

Recommended Posts

I want to apply the same background with repeat-x to multiple divs.I added a class to the divs, and my CSS was:

.class {width: 400px;height: 500px;border: 1px solid black;background: #xxxxxx url('URL') repeat-x fixed;}

Is there anything wrong? Because the background image was only applied to the first div, while the background color was applied to all.I thought it was because it was set to repeat-x and the divs were on top of each other (y); if that is the problem, how do I fix it.I hope I was clear, thanks in advance!EDIT: I'm new here, I'm sorry if it's the wrong forum. It didn't allow me to post on the CSS one...

Link to comment
Share on other sites

It's probably because you used fixed for the positioning. Read up on what using fixed does.

It didn't allow me to post on the CSS one...
Is that true, if you try to create a new thread in the CSS forum now does it tell you you're not allowed?
Link to comment
Share on other sites

Is that true, if you try to create a new thread in the CSS forum now does it tell you you're not allowed?
It was true. But now I can.Thanks!And also, as of what I know, "fixed" means the background doesn't scroll with the page (or, in this case, the div), right?If that's so, I kinda want it to be fixed :/EDIT: You were right! The fixed was unnecessary. Thanks for your help :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...