溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

?10個(gè)常用的CSS3屬性

發(fā)布時(shí)間:2021-01-29 13:42:03 來源:億速云 閱讀:185 作者:小新 欄目:web開發(fā)

這篇文章主要介紹10個(gè)常用的CSS3屬性,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

10個(gè)常用的CSS3屬性

1、文本效果

陰影:text-shadow:X偏移 Y偏移 模糊程度 陰影顏色; text-shadow: 5px 5px 5px #FF0000;文本溢出:text-overflow:ellipsis; overflow:hidden; white-space:nowrap;

2、字體

@font-face { font-family : 字體名稱; src : 字體文件在服務(wù)器上的相對或絕對路徑;}
調(diào)用:font-family: 字體名稱;

3、3D變形

位移:translate3d(x,y,z)、translateZ(z)縮放:scale3d(x,y,z)、scaleZ(z)旋轉(zhuǎn):rotate3d(x,y,z,angle)、rotateZ(angle)

4、多列布局

多列布局 columns:(column-width) || (column-count); column-width: auto | (length); column-count:auto | (integer);列間距 column-gap: normal || (length)列表邊框 column-rule:(column-rule-width)|(column-rule-style)|(column-rule-color)跨列設(shè)置 column-span: none | all

5、盒子模型

box-sizing: content-box | border-box | inherit

6、自由縮放屬性

resize:none | both | horizontal | vertical | inherit

7、前綴

-webkit-(chrome和Safari)、-moz-(firefox)、-ms-(IE)、-o-(opera)

8、邊框

圓角:border-radius: 5px 4px 3px 2px; /* 順時(shí)針 */
陰影:box-shadow: X軸偏移量 Y軸偏移量
[陰影模糊半徑] [陰影擴(kuò)展半徑] [陰影顏色] [投影方式];
/* 默認(rèn)外陰影*/外陰影 :box-shadow:4px 2px 6px #333333;
內(nèi)陰影: box-shadow:4px 2px 6px #333333 inset;
多陰影: box-shadow:4px 2px 6px #f00, -4px -2px 6px #000, 0px 0px 12px 5px #33CC00 inset;
邊界圖片:border-image: 圖片路徑 像素順時(shí)針 延伸方式(repeat重復(fù)
round平鋪 stretch 拉伸) border-image:url(border.png) 30 30 round; -webkit-border-image:url(border.png) 30 30 round; /* Safari 5 and older */ -o-border-image:url(border.png) 30 30 round; /* Opera */

9、背景 background

大?。?background-size: auto | <長度值> | <百分比> | cover | contain 原點(diǎn): background-origin : border-box | padding-box | content-box;

裁剪: background-clip : border-box | padding-box | content-box | no-clip 多重背景: background : [background-color] | [background-image] |
[background-position][/background-size] | [background-repeat] |
[background-attachment] | [background-clip] | [background-origin],...
【例】background:url(logoindex.png) no-repeat left top/75% 50% , url(logoindex.png) no-repeat right bottom/50% 45%;

10、漸變

線性漸變: //默認(rèn)從上到下、可以改變方向和角度
background: -webkit-linear-gradient(red, blue); /* Safari 5.1 - 6.0 */ background: -o-linear-gradient(red, blue); /* Opera 11.1 - 12.0 */ background: -moz-linear-gradient(red, blue); /* Firefox 3.6 - 15 */ background: linear-gradient(red, blue); /* 標(biāo)準(zhǔn)的語法 */
徑向漸變: background: -webkit-radial-gradient(red, green, blue); /* Safari 5.1 - 6.0 */ background: -o-radial-gradient(red, green, blue); /* Opera 11.6 - 12.0 */ background: -moz-radial-gradient(red, green, blue); /* Firefox 3.6 - 15 */ background: radial-gradient(red, green, blue); /* 標(biāo)準(zhǔn)的語法 */

以上是“10個(gè)常用的CSS3屬性”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI