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

  • Home
  • SEARCH
  • 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 7172735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:40:38+00:00 2026-05-28T15:40:38+00:00

How do you calculate the ‘used/determined’ height of an image when using width=100% .

  • 0

How do you calculate the ‘used/determined’ height of an image when using width="100%". I need this to determine whether or not to use the width="100%" or set a height with a max of n px. This is because of images getting to big for their box (div).

I would like to calculate in advance and not to resize the images after they’re displayed in the browser. (The scenario is in a product-layout).

  • 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-05-28T15:40:39+00:00Added an answer on May 28, 2026 at 3:40 pm

    If the height is the limit, why not use height as the property to adjust the image size as well?

    If this support is sufficient, you could use max-height and height:

    img {
      height:100%;
      max-height:115px;  
    }
    

    example: http://jsfiddle.net/JdQK6/

    You would set the max-height to the maximum height you’d want the image to be.

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

Sidebar

Related Questions

This is supposed to calculate the histogram of an 8-bit grayscale image. With a
I need to calculate an approximate image size in inches assuming 300dpi. I have
I'm trying to calculate the fft of an image using CUFFT. It seems like
I have to calculate the Specular Highlights (phong) of an Image. the normal Vector
to calculate some longitude and latitude values I need more decimal places like mysql
i need to calculate the age then in c programming how can i do
I need to calculate Crc16 checksums with a $1021 polynom over large files, below
Possible Duplicate: how to calculate difference between two dates using java I'm trying something
I want to calculate the checksum for a large tiff file that might not
I'm trying to calculate the conditional median of a chart that looks like this:

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.