Support » Themes and Templates » Stupid CSS question: Apologies in advance

  • Resolved biodrama

    (@biodrama)


    I just upgraded a blog to WP 2.8.3. I was using the K2 theme, ancient version 0.9.6, so I upgraded K2 as well. K2 has changed a bit, so I had to redo my custom style sheet somewhat. I use a tiled image background in div#page, but the new style sheet failed to call the tile from K2’s image folder. I am using a custom style sheet in k2/styles.

    I thought the syntax was
    #page {
    background: url(‘images/quilted_maple_tile.jpg’);
    }
    but this didn’t work. I ended up having to put in the full url of the
    image. Could this be because the K2 folder in the my themes directory is not
    entitled simply k2, but something like k2rc8v807? I apologize for the stupid question, but can’t seem to solve this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • If the stylesheet is in the same folder/directory as the images folder that should work.

    If it is in a folder called styles inside the K2 folder and the images folder is one level up (also in the K2 folder) then you will need to account for that level. An absolute path is best IMO, but you might be able to get away with adding: ../ (one level up) in front of images/quilted_maple_tile.jpg to make it ../images/quilted_maple_tile.jpg

    Thread Starter biodrama

    (@biodrama)

    Aha! You have provided a clue. The stylesheet is one level further in, because it resides in the custom styles folder. Perhaps I need to place my image in an additional images folder in the custom styles folder. I will try this.

    “images/quilted_maple_tile.jpg”

    the background tag searches its images relative to the css file, in this case an subdirectory images is expected in the directory the css file resides.

    Thread Starter biodrama

    (@biodrama)

    Thanks BPartch, for shining a light on what I failed to see. Problem is fixed, and I learned something important. The standard syntax works fine as long as the images folder is in the same directory as the stylesheet.

    And thank you to pboosten for confirming this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Stupid CSS question: Apologies in advance’ is closed to new replies.