background 背景属性的简写

来源:互联网 发布:html转php 编辑:程序博客网 时间:2024/06/05 20:03

通常使用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上时, 我们可以通过这种方法来进行微调;

0 0
原创粉丝点击