Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

css does not work


Go to End


7 Posts   3530 Views

Avatar
tgwpqd

Community Member, 7 Posts

9 December 2008 at 10:34pm

hi, i want to add a background picture, and in the layout.css and style.css i wrote:

body { line-height: 18px; font-size: 12px; font-family: arial; color: #999999; background: white url(images/headerBackground.png) repeat-x; }

however, it did not change anything. can anyone tell we what is the mistake i get?

Avatar
Invader_Zim

Community Member, 141 Posts

9 December 2008 at 11:24pm

Hi,

I can't see anything wrong in the code you posted...
But maybe you should check the path to your image, or you misspelled something.

Cheers

Avatar
Nivanka

Community Member, 400 Posts

9 December 2008 at 11:40pm

try with the follwoing

html { line-height: 18px; font-size: 12px; font-family: arial; color: #999999; background: white url(images/headerBackground.png) repeat-x; }

Avatar
tgwpqd

Community Member, 7 Posts

11 December 2008 at 7:59pm

hi,
i had checked that, the spelling is right.
also try the html{ }, but still not work

Avatar
Nivanka

Community Member, 400 Posts

12 December 2008 at 2:29pm

I got the error I think

the background URL is not correct.

html { line-height: 18px; font-size: 12px; font-family: arial; color: #999999; background: white url(../images/headerBackground.png) repeat-x; }

check with this

Avatar
Double-A-Ron

Community Member, 607 Posts

12 December 2008 at 4:26pm

Can you use Firebug HTML view to see if the style is being applied to your page? If you click on the body tag, all the styles that are applied to it will show up on the right panel.

Also try clearing your cache. Your old CSS may be stuck in there.

Other than that, if the color and background-color styles ARE being applied, and all that's missing is the image, you're safe to assume that the image path is incorrect.

Cheers
Aaron

Avatar
Willr

Forum Moderator, 5523 Posts

12 December 2008 at 4:37pm

I think you have your path incorrect. The layout.css is stored in css/ and the images are in images so your path to get to images folder from layout.css is

../images/filename.jpg