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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:27:20+00:00 2026-05-26T08:27:20+00:00

I just started to create a image viewer as a project but I was

  • 0

I just started to create a image viewer as a project but I was stuck at this point.

I used <img src="some.jpg" width="500" height="500" />.
The problem with this is, it works good if the image width is nearer to 500 or greater than 500 but
what if the image size is somwhere at 200 or 100 or 300?

It expands the image that has 200 width size to 500, this makes my images look so bad and this is not what I wanted. I just want the images that are greater than 500 to cut down to 500 and images like 200 or 300 width size should be same as 200 or 300.

If I use <img src="some.jpg" /> it takes the default image size.

jQuery solution is also much appreciated. I can find lots of jQuery image viewer plugins on the net but I want to make my own.

  • 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-26T08:27:21+00:00Added an answer on May 26, 2026 at 8:27 am

    You could try the CSS style “max-width” on the image.

    <img src="some.jpg" style="max-width:500px"/>.
    

    I put the CSS inline only for demonstration purposes.

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

Sidebar

Related Questions

Im very new to this android development.I just started to create a hello world
I started a test project just to get this down. No changes to main.xml.
Just started my first MVC 2.0 .net application. And I set up some default
I have just started learning XNA. This is my first program that I am
I've just started developing for Android. So far it's been surprisingly smooth sailing, but
I started to create a script that allows me to split a big image
I started a new project, and I chose to use ARC, but I've got
I have just started using IntelliJ IDEA.I am really novice to this IDE, so
I've just started trying to learn JS so apologies if this seems like a
I'm new to using vectors...I just started studying them today. I'm trying to create

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.