View Full Version : 2 images in 1 div at DIFFERENT times

11-18-2011, 12:58 AM
I'm working on a mobile version on a web site and while I know you can remove pictures according to views (Mobile, Tablet, Desktop) I want to use one div or two if that will work to display a different picture in the same area for mobile view.

So when you look at the site on the desktop it has a big picture (Img) and when you view it on a mobile screen it show a different picture. I do have 3 separate style sheets one for the each view.

Is it possible to tell the mobile css to turn off the tab/desktop div and display the mobile div img? or something like that.

I hope I've explained it well enough...

Thank you in advance,

11-18-2011, 03:57 PM
put all three in the div and ID them...

<img id="PC" ... />
<img id="Tablet" ... />
<img id="Mobile" ... />

then in your CSS (since you said you handle the platforms- and I presume the calls to the CSS files pend the platform) target accordingly... so for example the "PC" one might have this chunk of code

#PC {style it}
#Tablet {display:none;}
#Mobile {display:none;}

I have not yet coded for mobile devices and tablets, but I thought you did a lot more in the handling of determining "what the device is" server side script- if so you could also handle this server side script as well I assume but again my XP mobile/tab dev is null