Forums

[resolved] Stupid CSS question: Apologies in advance (5 posts)

  1. biodrama
    Member
    Posted 3 months ago #

    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.

  2. BPartch
    Member
    Posted 3 months ago #

    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

  3. biodrama
    Member
    Posted 3 months ago #

    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.

  4. pboosten
    Member
    Posted 3 months ago #

    "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.

  5. biodrama
    Member
    Posted 3 months ago #

    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.

Reply

You must log in to post.

About this Topic