On 2/08/2009, at 6:54 AM, Jenni Beard wrote:

> My question is, I am planning to use a CSS layout.  But, I will also  
> be
> using ASP code so that the image of the dancer will "randomize"  
> about 4-6
> similar images when a new page is loaded.  I know that ASP is OT for  
> this
> list, but I'm really not sure how to integrate the two together so  
> that the
> dancer images can be a background image for every page.  If I were  
> wanting
> to just randomize a content image (such as the sample image of the  
> studio
> shown in the draft), I know how to do that in ASP within the html  
> file, but
> I'm at a loss as to how to incorporate it into a background with  
> CSS.  Or,
> is this something that can be done strictly in CSS without having to  
> use the
> ASP randomizer code??

Use asp to output a randomised id and then set the background image  
for the different ids in your css.

If you have 6 images, create 6 ids and one class. The class can be  
used for setting the styles that apply to all of the images.

Your html might look like this...

<div class="dancer" id="dancer1"><!-- the id is randomised, sometimes  
it will be dancer2, dancer3 etc. -->.</div>

Your css might look like this...

.dancer {
        /* all of the styles for the element apart from bg-image */
}

#dancer1 { background-image: url(/path/to/image/dancer1.jpg); }
#dancer2 { background-image: url(/path/to/image/dancer2.jpg); }

etc.
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to