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 7513583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:13:42+00:00 2026-05-30T00:13:42+00:00

I am developing a web application where use can upload pictures. I create thumbnails

  • 0

I am developing a web application where use can upload pictures. I create thumbnails of various sizes. Lets say that one of the sizes is 240, 240 .

For this thumbnail when I render the image I want to put “height” and “width” attribute as it is recommended. However the image uploaded by user might be really tall and skinny. In that case the width will not be “240”.

What is the recommended height and width attribute for this case. Or should I not worry about height and weight attribute for thumbnails.

  • 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-30T00:13:43+00:00Added an answer on May 30, 2026 at 12:13 am

    No, you should not put an incorrect width and height on an img element. What you should do, however, is output the correct size image when you’re creating the thumbnail. For example, instead of scaling an image down from 500x200 to 240x96, create a new, transparent image that is 240x240 and place the scaled image (240x96) in the middle of the transparent image. Then, you can specify the width and height on the img, and not incorrectly stretch any images.

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

Sidebar

Related Questions

Background: We are developing a web application that includes charts. Currently one can left-click
I am developing a web application that uses JQuery AJAX and PHP to upload
I'm developing a web application that involves the use of timestamps. I would like
I'm developing a web application that requires the use of Cron. I'd like to
I am developing a web application that will require use of a MySQL database
I'm developing a web application I want to use the role authentication to control
I am developing a web application based on JSF technology. I use Eclipse as
I am developing a web application. For some reasons, I need to use external
I use tomcat. I am developing a web application using struts2, and I use
In the web-application I'm developing I currently use a naive solution when connecting to

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.