SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Apr 2010
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mobiles and image resizing

    I have a site where there is a background image and then several smaller images on a top layer.
    The smaller images appear too large on a mobile device. Can anyone tell me the best way to have these smaller images scale on a mobile but leaving the background image untouched?

  2. #2
    Barefoot on the Moon! silver trophy
    Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,524
    Mentioned
    52 Post(s)
    Tagged
    1 Thread(s)
    It's not a perfect solution, but this CSS code seems to work most of the time:

    Code:
    #mylogo img { max-width:100%; }
    Just remember to disable it for your desktop users:

    Code:
    #mylogo img { max-width:none; }
    Note that this does not change the amount of data being downloaded--just how the image is displayed in the browser.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain


Bookmarks

Posting Permissions

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