Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By TheGAME1264

Thread: Responsive Design and Resizing Images

  1. #1
    Junior Member usedearplugs's Avatar
    Join Date
    Feb 2014
    Posts
    12
    Member #
    38474
    Liked
    3 times

    Responsive Design and Resizing Images

    In responsive design, everything is based primarily on percentages.

    With old design standards in mind, an image should have it's size coded into the html or css, so that, while the image is still loading, the browser knows to leave that space for the image.

    Now, if you set an image to be 100% the width of its container but also code the image size to the img tag, the 100% will override, but it will skew the image. How can you get around this?

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    height: auto; in your CSS.
    usedearplugs likes this.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Junior Member usedearplugs's Avatar
    Join Date
    Feb 2014
    Posts
    12
    Member #
    38474
    Liked
    3 times
    You're a gentleman and a scholar! Thanks!

  5. #4
    Junior Member usedearplugs's Avatar
    Join Date
    Feb 2014
    Posts
    12
    Member #
    38474
    Liked
    3 times
    <h1 style="position:absolute; top:0%; left:0px; width:100%;"><img src="walt-davis-ranch.png" width="585" height="245" style="position:absolute; left:37.5%; width:33%; height:auto;"/></h1>
    In IE6 this image loads stretched tall, then if I resize the window it corrects itself. Any thoughts on that? It doesn't seem to matter whether or not I declare the height in the html or even if I do or don't set height to auto.

  6. #5
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Quote Originally Posted by usedearplugs View Post
    Any thoughts on that?
    Yes, 2:

    1. IE6 doesn't much like the height:auto. There's a workaround out there, I don't remember what it is, and it doesn't matter, because:
    2. IE6 represents almost zero percent of the browser market, and so it doesn't really matter if it works.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  7. #6
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Internet Explorer - IE 6 Countdown | Modern.IE

    That would be my thought on it. Unless you're targeting China, I wouldn't even give it a second thought. IE6 hasn't been bundled with a Windows OS since XP, and XP's product life cycle ends April 8.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  8. #7
    Senior Member DC Web Design's Avatar
    Join Date
    Jan 2014
    Location
    Washington, DC
    Posts
    128
    Member #
    38178
    Liked
    37 times
    Quote Originally Posted by usedearplugs View Post
    In responsive design, everything is based primarily on percentages.
    It's also about not wasting unnecessary bandwidth on devices that don't need to download a full-size, high-resolution image. While the width: 100%; and height: auto; is a quick fix, I'd look into implementing something like Foresight.js to make sure your visitors are getting the most optimized possible experience.

    Check it out here: https://github.com/adamdbradley/foresight.js

  9. #8
    Junior Member usedearplugs's Avatar
    Join Date
    Feb 2014
    Posts
    12
    Member #
    38474
    Liked
    3 times
    I understand that IE6 should hardly be supported now-a-days. But I usually work for people in small towns... Which means I design it for newer browsers and then they pull out an ancient piece of software to look at it and wonder why it doesn't look right.

  10. #9
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Check the server logs or website analytics. I'd bet the IE6 usage is almost none, if any. If it's below, say 2%, don't even bother. My site hasn't seen a hit from IE6 in over 2 years.

    EDIT: I take that back. There have been 3 hits in the last 2 yrs...out of 18,000 total
    Last edited by Ronald Roe; Feb 24th, 2014 at 08:06 AM.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:24 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com