i am using html. in html table i have a table row inside td i have company logo.
<image src="images\some.jpg">
but displayed image size is too large. is it possible to set height and width for it?
Please help me!
i am using html. in html table i have a table row inside td i have company logo.
<image src="images\some.jpg">
but displayed image size is too large. is it possible to set height and width for it?
Please help me!
There are width and height attributes, though it would behoove you to do a little reading up on cascading stylesheets (css).
<img src="..." width="100" height="200" alt="Company Logo"/>
You should be able to specify just the width or just the height to automatically scale the other dimension.
<td><img src='abc.png' height='x' width='y'></td> // set x and y to integers
You can set the width
and height
attributes of the image tag, like so:
<img src="../image/path" width="100" height="100" />
Also notice that using only one of those attributes, will resize the image keeping the aspect ratio, which will prevent the image from looking distorted.
Yes, you can use the height
and width
attributes, e.g. <img src=logo.gif alt=ACME width=50 height=20>
. You can also set the height
and width
properties in CSS.
When the width or height differs from the dimensions of the image itself, browsers rescale the image.
However, it is almost always better to scale the image in your favorite image processing program. Scaling down a large image that way lets you control the quality of the result, and it also saves bandwidth (and processing time in browsers).
Ideally you should never rely on this for your final optimized website, but you can use CSS 2's max-height and max-width to scale down an image and maintain the images aspect ratio. I have used this as a fail safe for php projects in the past when displaying user content. For example:
<style type="text/css">
.scaledimg {
max-height: 200px;
max-width: 200px;
}
</style>
<img class="scaledimg" src="imagesourcehere" />