+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Proper way to link to images from css?

Proper way to link to images from css?

3 posts, 0 answered
  1. Chris
    Chris avatar
    49 posts
    Registered:
    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
    Registered:
    09 Dec 2016
    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

    background:url(../Images/bg.gif);


    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
    Registered:
    14 Dec 2010
    20 Feb 2015
    Link to this post

    Ivan,

     How I can refer to image in theme from template?

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

     

    Thanks!

     

    P.S.: Seems, I found answer here: http://www.sitefinity.com/developer-network/forums/general-discussions-/images

3 posts, 0 answered