M
Mr. X.
Hello.
How can I stretch the image :
<img src= ... />
Thanks
How can I stretch the image :
<img src= ... />
Thanks
1. relative to the whole browser.
2. relative to the current page.
Use <img id="img-id" ... />
in html and
#img-id {
width: 25%; /* or any other relative unit */
}
in css.
Stretching images is IMO a bad idea,
"Mr. X. said:Hello.
How can I stretch the image :
<img src= ... />
Thanks
developer and substituting for the picture: pics/crimson.png
You can see it for yourself by opening either of the above in FF
developer and substituting for the picture: pics/crimson.png
Doesn't the above advice imply that you should start with the minimumChris F.A. Johnson said:I disagree. There is nothing wrong with resizing images in the
browser; however:
Don't supply a very large image and let the browser shrink it;
that is a waste of bandwidth and will be slow.
If you expect an image to be enlarged, check that the image is
of high enough quality to survive enlargement. (The ImageZoom
add-on for Firefox is good for testing this.)
You gave just the reasons why I think it needs serious consideration.
One could argue that from point A we conclude you can't shrink images
and from point B that you can't enlarge them.
Doesn't the above advice imply that you should start with the minimum
acceptable quality image at the expected _maximum_ size?
Ari Heino said:Use <img id="img-id" ... />
in html and
#img-id {
width: 25%; /* or any other relative unit */
}
in css.
Stretching images is IMO a bad idea, but I guess you have a good example
to give how to use it.
Actually, sometimes it's a very good idea, to ensure that an image which
is fixed width by nature (px) can never escape it's variable width (em,
% etc) parent container
Mr. X. said:What about :
stretching the image when it is a background-image in div.
"Mr. X. said:What about :
stretching the image when it is a background-image in div.
div1
{
position:absolute;
top:0px;
left:500px;
width:100%;
height:100%;
background-image:url('images/my_img.jpg');
background-repeat:no-repeat;
background-size:auto;
}
What should I do in order the background-image will be 50% width & height ?
Thanks
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.