我希望我的背景图像根据浏览器视口的大小进行拉伸和zoom .
I've seen some questions on Stack Overflow that do the job, like Stretch and scale CSS background for example. It works well, but I want to place the image using background
, not with an img
tag.
其中放置了一个img
标签,然后使用CSS向img
标签致敬.
width:100%; height:100%;
它可以工作,但是这个问题有点老了,并且声明在CSS3中调整背景图像的大小会很好地工作.我试过这个example the first one,但对我不起作用.
background-image
申报有什么好办法吗?