Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • blackhawk 313 posts 1368 karma points
    Dec 01, 2017 @ 22:47
    blackhawk
    0

    Best practices on referencing images in a style sheet

    I'm on Umbraco 7.6.7 I have over 30 image assets that will be referenced as background images to help "theme" the site.

    Does anyone have any good practices on

    1. Where inside my Visual Studio project should I store my theme images?
    2. How to reference these assets in my style sheet as background images?

    Thanks for any tips!

  • Ben Palmer 180 posts 866 karma points c-trib
    Dec 02, 2017 @ 09:34
    Ben Palmer
    100

    Hi blackhawk,

    I would usually create an assets directory in the root of the project, structured like this:

    assets
        - css
            - style.css
        - images
            - image.png
        - js
            - scripts.js
    

    In your stylesheet, you can then just reference the image using ../images/images.png

  • blackhawk 313 posts 1368 karma points
    Dec 02, 2017 @ 13:06
    blackhawk
    0

    That's exactly what I tested out and everything still works with the site.

    Thank you very much!

Please Sign in or register to post replies

Write your reply to:

Draft