Design and CSS styles
Version 3.x > Design and CSS styles > css background-image View modes: 
User avatar
Member
Member
chris-ricochetpartners - 9/12/2008 12:30:47 PM
   
css background-image
What is the correct syntax to specify a background image in the css when using the default CSS indicated as such:

<link type="text/css" rel="stylesheet" href="/CMSPages/GetCSS.aspx?stylesheetname=RicochetPartners" />

My current css line is:

background-image:url(images/bg_pattern_blk.jpg);

this points at an image in the App_Themes\RicochetPartners\ folder but the images are not showing. Is there something different I need to do when using the system generated <link> tag.

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 9/15/2008 9:25:37 AM
   
RE:css background-image
Hello,

Could you please try to use following relative path: "../App_Themes/CorporateSite/Images/bg_pattern_blk.jpg" ?

So the final CSS property will look like:

background-image:url(../App_Themes/CorporateSite/Images/bg_pattern_blk.jpg);

Best regards
Ondrej Vasil

User avatar
Member
Member
chris-ricochetpartners - 9/15/2008 11:03:30 AM
   
RE:css background-image
Thanks, that worked. Now I am having trouble setting the path to the button image for a cmssearchbox. My image is located in App_Themes/{site name}/images. I tried both the relative path above and "App_Themes/{site name}/image/filename.jpg" but it doesn't resolve.

User avatar
Member
Member
chris-ricochetpartners - 9/15/2008 11:57:22 AM
   
RE:css background-image
I figured this out using the IE Developer Tool. The relative path must be from the CMSWebParts folder, which is ../App_Themes/{site name}/images/{image name}