在HTML背景中拉伸图像 [英] stretch the image in HTML background
本文介绍了在HTML背景中拉伸图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨.
我想知道如何在html中而不是在任何javascript或css中拉伸背景图像.....
请帮我...
Sudheer
Hi.
I want to know how to stretch the backgound image in html not in any javascript or css.....
please help me...
Sudheer
推荐答案
解决方案在这里:
http://stackoverflow.com/questions/1150163/Stretch-and-scale-a-css-image-background-with-css-only [
The solution is here:
http://stackoverflow.com/questions/1150163/stretch-and-scale-a-css-image-background-with-css-only[^].
—SA
尝试为
使用
拉伸后的背景图像
Try as
use
Streched backgroungd image
<img src="myimg.jpg" width="100%" height="100%" alt="ImageShow">
</img>
如果要根据容器的宽度拉伸图像,可以在width属性中使用相对宽度来进行拉伸.
If you want to stretch an image depending on how wide it''s container is, you can do so with a relative width in your width attribute.
<img src="image.jpg" width="100%" height="150">
<img src="image.jpg" width="50%" height="150">
但这会拉伸小的图像,以至于我们无法找出实际的图像.
But it stretches small images so much that we are unable to figure out actual image.
这篇关于在HTML背景中拉伸图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文