Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » css does not work

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

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

Page: 1
Go to End
Author Topic: 1907 Views
  • tgwpqd
    Avatar
    Community Member
    7 Posts

    css does not work Link to this post

    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?

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: css does not work Link to this post

    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

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: css does not work Link to this post

    try with the follwoing

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

  • tgwpqd
    Avatar
    Community Member
    7 Posts

    Re: css does not work Link to this post

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

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: css does not work Link to this post

    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

  • Double-A-Ron
    Avatar
    Community Member
    603 Posts

    Re: css does not work Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: css does not work Link to this post

    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

    1907 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.