Forums

Twenty-Ten Background Image Using CSS (8 posts)

  1. ricketts8
    Member
    Posted 1 year ago #

    (first, I know about child themes, please do not tell me to make child themes and then not answer my query)

    I would like to write CSS for my background image instead of using the background image selector via the admin panel. I've searched Google for a way to deactivate this function and haven't found a good answer. Anyone know how to deactivate the Theme's Background Image Selector and write CSS instead?

  2. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    you can just ignore the background image selector & set the background using css as you normally would.

    for example:

    body {
    	background: #E7CA30 url(images/bg.png) repeat fixed;
    }
  3. ricketts8
    Member
    Posted 1 year ago #

    Nope.

  4. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    What do you mean by 'nope'?

  5. ricketts8
    Member
    Posted 1 year ago #

    Sorry, just frustrated. No, the code you suggested didn't do anything. I've tried several different variations in CSS to get it to show and nothing's happening. Yet when I go in through the admin panel it changes right away.

  6. alchymyth
    The Sweeper
    Posted 1 year ago #

    the cause is that the 'background function' embeddes the styles into the head area, which gives it precedence over styles in style.css.

    you can force the body background in the style.css to rule by adding !important; for instance:

    body {
    	background: #E7CA30 url(images/bg.png) repeat fixed!important;
    }
  7. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    If there is no image specified within the background image selector, it doesn't put anything into the head area. I copied & pasted that css example directly from a twentyten child theme I'm running on a site.

  8. ricketts8
    Member
    Posted 1 year ago #

    Okay, so both options seem to work. Thanks.

    Here's a follow-up

    htmlgiant.com

    It seems, looking through Firebug, this site has two background images. I've replicated the code in my stylesheet (twenty-ten) but it isn't exactly working.

    Any idea how to replicate that? I'm experimenting as we speak but I can't get it to go.

Topic Closed

This topic has been closed to new replies.

About this Topic