Image usage in CSS

Hi Folks,


I am getting started with using the Design Guide, and am trying to work out if I'm missing something.



I have items in a css file that have an image associated with them (divs). Do I need to use a different URL for those than the standard "mysource_files"? The URL of the css that shows up in the browser is:



/_designs/design_74/mainstyles.css



Does this mean that I need to have my css use that relative URL for it's image files as well? So instead of "mysource_files/example.gif" it would be "/_designs/design_74/example.gif"? I've tried hardcoding this into the CSS file and it works, but obviously this isn't ideal.



Can anyone help me here?



Thanks, Tom

mysource_files won't work in file assets, you would need to use a css asset, or preferably move the css rules that reference images into the head of the design parse file (where 'mysource_files' is replaced with the correct file path to the file).

Thanks, Anthony.


I’ve created a “CSS File” in my Designs folder at the same level as my Parse file, and then have created a link under the Parse file to the css file. In my parse file I’ve then entered:



<MySource_AREA id_name=“css_file” design_area=“linked_css”>

<MySource_SET name=“tag_type” value=“import_tag” />

<MySource_SET name=“media” value=“all” />

</MySource_AREA>



But for some reason it’s not importing the css file correctly. I get error messages in the HTML pages when I view them as follows:



PHP Notice

Undefined index: example.gif



And when I look in the page source, there’s no CSS link been created at all. Here’s something like what I’m expecting:



<link href=“link_to_css.css” rel=“stylesheet” type=“text/css” />



What am I missing here?



Here’s an example of what I have in the ParseFile of the CSS File:



.bkmain {

background-attachment: fixed;

background-image: url(mysource_files/example.gif);

background-repeat: repeat-y;

}



And then I have example.gif as a link under the CSS File.



Nevermind… Got it working thanks to this post: http://forums.matrix.squiz.net/index.php?showtopic=1999





Thanks! Tom