Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7740195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:42:55+00:00 2026-06-01T08:42:55+00:00

Is this CSS for sizing an <img> to 100% height and maintaining the ratio

  • 0

Is this CSS for sizing an <img> to 100% height and maintaining the ratio reliable (cross-browser)?

#reel img
{
    height: 100%;
    width: auto;
}

It seems to work on what browsers I have, but I’m sceptical of the auto value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:42:57+00:00Added an answer on June 1, 2026 at 8:42 am

    Short answer: yes. That’s how you do it. Not sure what more to add. Edit: You could add !important to the auto-rule just in case the img has an inline width attribute. Edit2: Actually the !important doesn’t seem necessary: http://jsfiddle.net/Z7ME8/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to make this css code cross browser compatible using jquery. this code only
With this css .addProblemClass{ width:300px; height:300px; /*width:25%; height:40%;*/ border:solid 1px #000000; margin: 5px; background-color:#FFFFFF;
With this css .addProblemClass{ width:300px; height:300px; border:solid 1px #000000; background-color:#FFFFFF; opacity:0.9;/*For chrome and mozilla*/
I have this css: @media only screen and (max-height: 620px) { #howto img {
I have got this css: <style type=text/css> #heading{ margin:auto; background-color: brown; } </style> and
I have this CSS rule: #panelSeparator .active { background: #fff url(../img/vgrabber.gif) no-repeat center; opacity:
This works: $.fn.center = function () { this.css(position, absolute); this.css(top, ($(window).height() - this.height()) /
This CSS style applies to links inside a table which the class property is
I found this css body { font: 13px/1.231 arial,helvetica,clean,sans-serif; *font-size: small; *font: x-small; }
I have this css: fieldset li { padding-bottom: 0em; } However, it wasn't behaving

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.