《CSS揭秘》47 个 css 技巧让你在面对各种 css 问题的时候游刃有余,css 进阶必备。


1.灵活的背景定位
1.background-position 扩展语法,我们可以在 position偏移量前面指定关键字。
.box{
border: 1px solid;
height: 400px;
width: 400px;
margin: 10px auto;
background-image: url('https://123p3.sogoucdn.com/imgu/2020/02/20200213153937_653.png') ;
background-repeat: no-repeat;
/* background: right 20px bottom 10px; */
background-position :right 20px bottom 20px;
}
本文介绍《CSS揭秘》中关于背景定位的技巧,通过扩展background-position属性的使用方式,实现更灵活的背景图片定位效果。
1208

被折叠的 条评论
为什么被折叠?



