使背景图片自动适应浏览器屏幕(代码教程)
程序员文章站
2024-01-22 16:16:52
用chrome浏览器正常显示。以下为CSS代码:
.auto-picture
{
background-image: url(../img/login-1.png);...
.auto-picture { background-image: url(../img/login-1.png); background-position: center 0; background-repeat: no-repeat; background-attachment: fixed; background-size: cover; -webkit-background-size: cover; -o-background-size: cover; -moz-background-size: cover; -ms-background-size: cover; }
放在<body>标签,chrome浏览器可以正常使用!
上一篇: N个必备的实用jQuery代码段
下一篇: Centos6和7的区别