Solved

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

Posted on 2011-03-14
4
287 Views
Last Modified: 2012-05-11
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
Comment
Question by:lapucca
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Vampireofdarkness earned 500 total points
ID: 35135456
Get the dimensions of the image (ie- 600 x 400), divide those by 4.

<img src='image.png' width='150' height='100' />
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 35135460
did you tried giving specific height and width to that img?

<img src="" height="100px" width="100px"/>
0
 
LVL 9

Expert Comment

by:Vampireofdarkness
ID: 35135470
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
 

Author Closing Comment

by:lapucca
ID: 35135590
Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now