您现在的位置:首页 >> 前端 >> 内容

background背景属性的简写

时间:2017/5/5 17:02:00 点击:

  核心提示:background背景属性的简写。通常使用background 属性 都是如下写法:background: url(../images/stock_taking/branch.png) no-rep...

background背景属性的简写。通常使用background 属性 都是如下写法:

background: url(../images/stock_taking/branch.png) no-repeat right bottom ;

最近一个在做一个项目发现 最后的两个position属性值 还可以进行微调;

例如:background: url(../images/stock_taking/branch.png) no-repeat right 5px bottom 5px;

那这样加两个带有像素单位的属性, 就可以使背景图标 定位在距离元素最右侧5像素 下部5像素处 ;

当背景图标紧贴在元素的border上时, 我们可以通过这种方法来进行微调;

Tags:BA AC CK KG 
作者:网络 来源:Anpanda的博客