大佬教程收集整理的这篇文章主要介绍了css – 将背景图像放在中心并向左和向右重复最后一个像素,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
-------------- repeat last pixel of the right of the picture to the right | | | | -------------- ^ | here repeat to the left the first pixels to the left
在图片下方,最低的像素行重复下来.
我希望你明白我的意思……
小须
基本上,您使用背景图像渲染“完整”图像,使用背景位置将其定位在中心.
#container { height: 100vh; width: 100%; margin: 0 auto; padding: 0 20%; box-sizing: border-box; BACkground-image: url(https://s3-us-West-2.amazonaws.com/s.cdpn.io/44521/light_minimalistic_soft_shading_gradienT_Background_1024x768_58884.jpg); BACkground-size: 61% 100%; BACkground-position: center 0; BACkground-repeat: no-repeat; }
然后,您可以使用border-image作为重复边缘.请注意,使用border-image-slice只能抓住侧面的1px边缘.
#container { border-width: 0 20% 0 20%; border-image-source: url(https://s3-us-West-2.amazonaws.com/s.cdpn.io/44521/light_minimalistic_soft_shading_gradienT_Background_1024x768_58884.jpg); border-image-slice: 2; border-image-width: 2 20%; border-image-repeat: stretch; border-image-outset: 2px; }
以上是大佬教程为你收集整理的css – 将背景图像放在中心并向左和向右重复最后一个像素全部内容,希望文章能够帮你解决css – 将背景图像放在中心并向左和向右重复最后一个像素所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。