SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    731
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Resizing Images For Smartphones

    Hi,

    I am trying to resize images for smartphones such as the iPhone. When I view my site on a phone the images fail to resize. I have this code in my CSS. I am wondering though whether it is not specifically images that is causing the problem.


    Code:
    img {
        width: 100%;
    max-height:100%;
    border: none;
    }

  2. #2
    SitePoint Zealot Sogo7's Avatar
    Join Date
    May 2011
    Posts
    129
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    No, it will not be the images it's definitely your CSS.

    "img 100%" tells the browser to scale the image to fill all of the <div> that surrounds it.

    Have you seen the Skeleton boiler plate system? It's a ready made blank template
    that automatically scales images and arranges text to fit any display screen.
    Lovelogic.net Personal Projects Pit - Spammers welcome


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
  •