ASPX templates
Version 4.x > ASPX templates > Image urls View modes: 
User avatar
Member
Member
AP-Kentico - 7/14/2009 4:25:14 PM
   
Image urls
Hi,

I created a web part which has a div tag with background image like:
The image is stored in the folder specified.
I also added this web part in the web parts in the MyWebParts folder.
However, the div bg image appears only on one page. I have also added this on on the website master page put I do not see it there. I exists as I can set a background color and that appears.

<div style="background-image: url('../App_Themes/CorporateSite/Images/Accessibility-BG.png'); width:649px; height:53px; background-repeat: no-repeat;">
.....

It seems that my image url is incorrect.
What url should I be using for this?

Thanks,
AP

User avatar
Member
Member
bluerhino_avanmeter - 7/15/2009 8:24:50 AM
   
RE:Image urls
Try url('~/App_Themes/CorporateSite/Images/Accessibility-BG.png')

You could also define a class for the div in your CSS file for the site, and use the '../App_Themes' url there.

Aaron

User avatar
Member
Member
AP-Kentico - 7/15/2009 9:48:34 AM
   
RE:Image urls
Well, it works.
Its kind of stupid. I was using background-image but when I changed it to background it works. Visual studio default attributes sometimes don't work.

Thanks.