html背景过大,html – CSS – 背景大小:封面太大了
當(dāng)我嘗試使用具有固定位置的background-size:cover屬性時(shí),我的圖像變得太大,并被裁剪.我希望它與原始圖像的大小相同,但我無法弄清楚這一點(diǎn).我試圖保持圖像的影響保持原位.#wrapper {
width:100%;
height:580px;
background-image:url('http://www.myorderdesk.com/Providers/206190/Files/31/full_width_image_1.jpg');
background-position: center center;
background-attachment:fixed;
background-repeat: no-repeat;
background-size: 100% 100%;
/*background-size:cover;*/
-webkit-transition: background-image 0.4s;
-moz-transition: background-image 0.4s;
-ms-transition: background-image 0.4s;
-o-transition: background-image 0.4s;
transition: background-image 0.4s;
overflow: hidden;
-webkit-font-smoothing: subpixel-antialiased;
}
這是我的Demo
最佳答案 試試這個(gè)覆蓋:#wrapper {
background-size:contain;
}
總結(jié)
以上是生活随笔為你收集整理的html背景过大,html – CSS – 背景大小:封面太大了的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微型计算机原理与接口技术教材,微型计算机
- 下一篇: 湖北经济学院法商学院计算机分数线,湖北经