I am currently building a site via MODx 0961.p2 and have created a template and associated stylesheet. Some of the style IDs have background image and color properties. When the background properties are specified in the stylesheet however, they simply do not show up in the site. I can only get them to show up if the properties are defined inline within the IDs when listed in the site template. See examples below:
These appear in the Template itself, and they render properly in the site:
<body style="background-image: url(assets/images/bodybg.png); background-repeat: repeat-x;">
<div id="menu" style="background-color: blue;">
If placed in the site’s default stylesheet however, these background properties simply won’t display:
body {
background-image: url(assets/images/bodybg.png);
background-repeat: repeat-x;
}
#menu {
margin: 0px 0px 0px 0px;
padding: 0px;
width: auto;
height: 40px
background-color: blue;
border-top: 0px solid #999999;
border-bottom: 3px solid #999999;
text-align:left;
z-index: 12;
}
I am at a loss here. Any ideas as to why this is happening?
Thanks folks.
- Marconi
-
☆ A M B ☆
- 24,524 Posts
Image URLs are relative to the stylesheet .css file. So your stylesheet is looking for assets/images in the same folder where the .css file resides. Try putting your style-specific images in an images folder in the same folder as your css file. Or else make sure you are specifying the correct path to the images relative to the location of the .css file.
thanks sottwell. but that does not explain why i am also having the same problem when i simply specify a background color (and no image is being called). even background colors do not display when called from the css file. i need to specify them as inline style declarations within the template itself. there seems to be something else going on here.
You’re missing a semicolon after the height declaration in the menu div.
Argh, those darn, elusive, semicolons!
Thanks very much bob. It is all resolved now.
- Marconi