Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 313
  • Last Modified:

How can I have a png image file appear smmaller then its size?

Hi, I'm just using html and jQuery for this.  I have a few images in png file.  It's made 4 times the size then I actually need because the person who make them think it would look better when it's sized to med and large size in the program.  How do I make it look about 25% of its original size?  In img tag?  Thanks
0
lapucca
Asked:
lapucca
  • 2
1 Solution
 
VampireofdarknessCommented:
Get the dimensions of the image (ie- 600 x 400), divide those by 4.

<img src='image.png' width='150' height='100' />
0
 
Gurvinder Pal SinghCommented:
did you tried giving specific height and width to that img?

<img src="" height="100px" width="100px"/>
0
 
VampireofdarknessCommented:
Failing that, if you MUST use jQuery, you could use something like

HTML: <img src='image.png' id='myimage' />

JS:
$(document).ready(function() {
  $('#myimage').css('height':($(this).height()*0.25),'width':($(this).width()*0.25));
});

Untested, but should work.
0
 
lapuccaAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now