Solved

Using variable to select background image in div

Posted on 2006-07-10
2
324 Views
Last Modified: 2006-11-18
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 %>  

0
Comment
Question by:ksilvoso
2 Comments
 
LVL 2

Accepted Solution

by:
almes earned 125 total points
ID: 17080931
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
 
LVL 1

Author Comment

by:ksilvoso
ID: 17107369
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now