在CSS中拉伸背景 [英] stretching background in CSS
本文介绍了在CSS中拉伸背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
如何在Div中拉伸背景图像,使其显示的高度与原始高度不同?实际上,它是一个横幅Div。我该怎么办?
Hello,
How can I stretch the background image in a Div so that it can be shown complete in different height than its original? Actually, its a banner Div. What should I do?
推荐答案
stackoverflow上的这个线程将帮助你: http://stackoverflow.com/questions/1150163/stretch-and-scale-a-css-image-background-with-css-only [ ^ ]
还有一个css3属性:
This thread at stackoverflow will help you out: http://stackoverflow.com/questions/1150163/stretch-and-scale-a-css-image-background-with-css-only[^]
There is a css3 property also:
<body style="background-image: url(/image.jpg); background-repeat: no-repeat; background-size: 100% 100%;">
< body style =background-image:url(/ imag e.jpg);背景重复:不重复; background-size:100%100%;>
<body style="background-image: url(/image.jpg); background-repeat: no-repeat; background-size: 100% 100%;">
这篇关于在CSS中拉伸背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文