background image position (6 posts)

  1. dmd54
    Posted 1 year ago #

    I'm trying to change the position of a background image. I've tried

    background-position: center 150px;

    but nothing is happening. the default WP style is still adhering to center top.

    am I missing something?

  2. Andrew
    Bawk bawk moderator
    Posted 1 year ago #

    You'll need to link the page with the issue

  3. dmd54
    Posted 1 year ago #

    Hi Andrew - unfortunately I can't link it because it's local hosted right now.

    This is the style applied, copied from firebug:

    body.custom-background {
        background-attachment: scroll;
        background-image: url("http://localhost/wordpress/wp-content/uploads/2014/05/istock_000009454074small-copy1.jpg");
        background-position: center top;
        background-repeat: no-repeat;

    And this is from my style sheet:

    body {
    	-moz-font-smoothing: antialiased;
    	-webkit-font-smoothing: antialiased;
    	background: #efefef;
    	background-size: 100%;
    	background-position: center 150px;
    	color: #555555;
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 14px;
    	font-smoothing: antialiased;
    	line-height: 1.5em;
    	text-rendering: optimizeLegibility;
  4. Andrew
    Bawk bawk moderator
    Posted 1 year ago #

    Or replicate the issue on a sandbox http://cssdesk.com/

  5. Michael
    Part-Time Forum Moderator
    Posted 1 year ago #

    what theme are you working with?

    the background styles are likely embedded into the head section; therefore they will get used after your custom styles.

    you will need to make your custom styles at least as specific as the background styles from the theme; possibly as last resort, try working with !important

  6. dmd54
    Posted 1 year ago #

    Alychymth - Thanks. Worked with !important.

Topic Closed

This topic has been closed to new replies.

About this Topic