Solved

CSS how to scale image to 50px by 50px

Posted on 2011-09-08
6
464 Views
Last Modified: 2012-05-12
Please can someone advise how I should modify the below css to scale my image down to 50px by 50px. the reason we don't want to use a 50px by 50px native image is so we can preserve the quality of the image edge for transparency to be effective.

	.mstrLogo {
		background: 		transparent url(images/project.gif) no-repeat scroll center;
	}
	A.mstrLink:hover .mstrLogo {
		background-image: 		url(images/project.gif);
	}
	* HTML .mstrLogo {
		filter: 		progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../plugins/ReplacingMicroStrategyWebButton/style/images/project.gif', sizingMethod='scale');
	}
	* HTML A.mstrLink:hover .mstrLogo {
		filter: 		progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../plugins/ReplacingMicroStrategyWebButton/style/images/project.gif', sizingMethod='scale');
	}

Open in new window

0
Comment
Question by:regnighc
6 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36503365
why not simply mention the height and width as 50px?
0
 
LVL 2

Author Comment

by:regnighc
ID: 36503506
Sorry I cant work out how todo that First time ive played with css this is a premade file
0
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36503558
is this a background image that you want sized?
if so then look at this link http://stackoverflow.com/questions/1341358/set-size-on-backgroundimage-with-css
You can size a background image for browsers that are css3 compliant with the background-size but that does not work with most browsers so your best bet would be just to re-size the image before use.
Otherwise there is the normal width and height that you can set with css to size anything else.
0
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 500 total points
ID: 36514798
<IMG src="mythumb.jpg" width="50 px" height="50 px">  that is the HTML
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37343905
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
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

Suggested Solutions

Title # Comments Views Activity
Why won't this text float to the left 8 26
Having a little issue with EDGE/IE CSS display of after 2 30
CSS z-index issue 3 22
Target h5 of a div 3 8
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

895 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

20 Experts available now in Live!

Get 1:1 Help Now