Click to See Complete Forum and Search --> : "Help me if you can, im..."


alexthomas
03-20-2003, 11:00 AM
Hi everyone,

wondering if anyone can help me,

In HTML is there any way that when you resize the image in html, ie Height="*" width="*" so that it crops the image instead of stretchin/shrinking it?

I hope this is an easy question.

Thanks in advance

Alex

Nedals
03-20-2003, 12:42 PM
You cannot do it with just HTML but it can be done with a little CSS.
Try this...
<html><head><title>Untitled</title>
<style type="text/css">
.imgClip { position:absolute; clip:rect(20 100 100 20) }
/* clip:rect(top,right,bot,left) */
</style>
</head>
<body bgcolor="#ffffff>
<img src="sample4.jpg" class="imgClip">
</body>
</html>

Note: The image must use position:absolute for thsi to work.