Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-03-14
4
Medium Priority
?
298 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
[X]
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
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Vampireofdarkness earned 2000 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:Gurvinder Pal Singh
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

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

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…
This article discusses how to implement server side field validation and display customized error messages to the client.
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 style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

730 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