Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Thanked 0 Times in 0 Posts

    Post 2 images in 1 div at DIFFERENT times

    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,

  2. #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Thanked 210 Times in 209 Posts
    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

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts