Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2011-03-14
4
290 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

828 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