站内搜索:
首页 >> 前端 >> 内容
background背景属性的简写

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

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

  • 上一篇:css盒子模型之定位
  • 下一篇:Pythonerror:MicrosoftVisualC++9.0isrequired解决方案
  • 返回顶部