亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

CSS3教程:background-clip和background-origin

互聯(lián)網   發(fā)布時間:2008-10-17 19:22:43   作者:佚名   我要評論
原文:http://www.planabc.net/2008/04/14/background-clip_background-origin/ background-clip 和 background-origin 是 CSS3 中新加的 background module 屬性,用來確定背景的定位。 background-clip 用來判斷 background 是否包含 border 區(qū)域。而 background-or

下面舉個運用 background-origin 屬性的簡單例子,效果如下圖:
運行代碼框

[Ctrl A 全部選擇 提示:你可先修改部分代碼,再按運行]


HTML 部分:
<button>這里是按鈕,是鈕不是妞</button>
CSS 部分(詳細見注釋):
button {
display:inline-block;/*觸發(fā)hasLayout*/
height:26px;
padding:0 20px;
cursor:pointer;
*overflow:visible;/*消除IE按鈕左右padding隨字數長度變化的BUG*/

border:3px double #95071b;/*用3px 雙邊來模擬設計圖中的白線*/
border-right-color:#650513;
border-bottom-color:#650513;

background-color:#95071b;

/*設置背景裁切方式和參考線*/
-moz-background-clip:padding;
-webkit-background-clip:padding;
-khtml-background-clip:padding;

-moz-background-origin:padding;
-webkit-background-origin:padding;
-khtml-background-origin:padding;

/*向前兼容*/
background-clip:padding;
background-origin:padding;

color:#fff;
font-size:12px;
line-height:20px;

/*修正IE6下高度問題*/
_padding-top:2px;
_line-height:14px;
}

不足之處:此效果在 Opera 下無法實現(xiàn)。
當然這只是一種對 HTML 代碼有潔癖的解決方法(限于對 background-clip 和 background-origin 屬性的學習和理解),當然也可嘗試其他方法,也許會使 CSS 更簡潔,至于各種方法的優(yōu)缺點自己衡量。
擴展閱讀:
《Background and Border》
點擊這里返回 網頁制作 欄目

相關文章

最新評論