在我的网站的首页,我有一个图像,我想要适合屏幕/设备的高度,如果设备高度改变它应响应反映通过调整大小(不裁剪) . 我如何实现这一目标?
我希望我有道理,请参阅this jsfiddle作为我想要达到的目标的一个例子 .
尝试:
min-height:100%; min-width:100%;
尝试将其作为背景并使用
background: url(images/bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;
资料来源:http://css-tricks.com/perfect-full-page-background-image/
1 回答
尝试将其作为背景并使用
资料来源:http://css-tricks.com/perfect-full-page-background-image/