CSS:将图片拉伸到100%的宽度 [英] CSS: Stretching image to 100% width
本文介绍了CSS:将图片拉伸到100%的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好 我正在尝试拉长我侧边的背景以适应宽度.我只在互联网上找到了较大的解决方法.对此没有一个命令吗?
Hi all I am trying to strech the background of my side to fit the width. I only found big workarounds in the internet. Is there not one single command for this?
body {
background-image: url(money.jpg);
}
感谢您的回答. o
推荐答案
使用背景-size ,如下面使用的
body {
background-image: url(money.jpg) no-repeat;
background-size: 100%;
}
一些有用的链接:
- Scale background image style
- Stretch and Scale a CSS image Background - With CSS only
这篇关于CSS:将图片拉伸到100%的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文