好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

【CSS3】-background-originbackground-clipbackground-

background-origin

设置元素背景图片的 原始起始位置 。

语法:

background-origin : border-box | padding-box | content-box; 

参数分别表示背景图片是从 边框 ,还是 内边距(默认值) ,或者是 内容区域 开始显示。

效果如下:

需要注意的是 ,如果背景不是 no-repeat ,这个属性无效,它会从边框开始显示。

例子:

      背景原点  .wrap {    width:220px;     border:20px dashed #000;     padding:20px;     font-weight:bold;     color:#000;     background:#ccc url(http://static.mukewang.com/static/img/logo_index.png) no-repeat;     background-origin:content-box;//内容区域显示    position: relative;}.wrap span {     position: absolute;     left:0;     top:0;}.content {    height:80px;     border:1px solid #333;}      

padding

content

查看更多关于【CSS3】-background-originbackground-clipbackground-的详细内容...

  阅读:35次