I'm making a website where I need to have a notable difference between fill and center background images. My template is this:
Center: Uses native resolution to determine size.
Fill: Fits sides to fill screen without changing aspect ratio. Two sides exactly fit screen, while other two are cut off.
我设法以
.center {
background-repeat: no-repeat;
background-size: auto auto;
background-position: center center;
}
但我不知道如何填充。有什么见解吗?
我相信你想要background-size: cover
. 其他背景大小选项 https://developer.mozilla.org/en-US/docs/Web/CSS/background-size.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)