Using variable to select background image in div

I need to set the background image to div id depending on which site someone is at. i can determine the site from the UnivID but I cannot get the background to div id frame to show up.

I am using this to check for the UnivID and try to set the background image. Images exist and are in the right location cause I can use CSS to assign the image statically, but I need it dymanic. Anyone see a problem with this code?

<% if request.Querystring("UnivID") = "1" then
                   response.write("<div id='frame' background-image: url(littlerock/images/ltrk.jpg);>")
                   else if request.Querystring("UnivID") = "2" then
                             response.write("<div id='frame' background-image: url(memphis/images/memphis.jpg);>")
                             end if
          end if %>  

LVL 1
ksilvosoAsked:
Who is Participating?
 
almesConnect With a Mentor Commented:
background image is a style attribute not a DIV attribute, that is why you should use:

<div id='...' style='background-image:url(...)' >

good luck...
0
 
ksilvosoAuthor Commented:
Thanks, that got it, altho only in IE. I will have to look around for the hack for Mozilla, or do you know what it should be?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.