Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    1
    Thanks
    0
    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,
    BigMarkess

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,752
    Thanks
    41
    Thanked 191 Times in 190 Posts
    put all three in the div and ID them...

    Code:
    <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
    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
    •