More in this section
Forums / General Discussions / Proper way to link to images from css?

Proper way to link to images from css?

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
3 posts, 0 answered
  1. Chris
    Chris avatar
    49 posts
    20 Jul 2010
    01 Sep 2010
    Link to this post
    I'm attempting to create a custom theme in sitefinity 4. Right now I'm working with the layout.css file in my new theme but I need to add references to images stored in the images folder. Right now I have to use a very long url to get to the images, while I've seen in other theme's css files some type of folder referencing that uses . (period) instead of / .

    I have to use : /sitefinity4/Sitefinity/WebsiteTemplates/MaxQ/App_Themes/DefaultTheme/images/bg.jpg

    while I see this used elsewhere :
    url(<% = WebResource("Telerik.Sitefinity.Resources.Themes.Basic.Images.sfPublicContent.gif") %>)

    What's going on there? Can I use that type of referencing? I've read through the designers guide and it tells me everything except how to actually design and implement a theme... although it was helpful when I was setting up the new theme.

    What is the preferred way for defaultheme/global/layout.css or reference images stored in defaulttheme/images ?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    03 Sep 2010
    Link to this post
    Hello Chris,

    The stylesheet is located in the theme folder where is Images folder, so you can reference an image as shown below


    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Oliver
    Oliver avatar
    1 posts
    14 Dec 2010
    20 Feb 2015
    Link to this post


     How I can refer to image in theme from template?

     For example, I've added Content Block and need to add <img> tag.




    P.S.: Seems, I found answer here:

3 posts, 0 answered