国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

前端 - CSS3問(wèn)題:請(qǐng)問(wèn)-webkit-background-clip屬性,需要寫在background屬性后面嗎?

瀏覽:174日期:2023-07-22 08:48:20

問(wèn)題描述

<!DOCTYPE html><html><head><meta charset='utf-8'><title>background-clip:text</title><meta name='description' content=''><meta name='keywords' content=''><link href='http://www.intensediesel.com/wenda/6013.html' rel='stylesheet'><style>*{margin: 0; padding: 0;}p{width: 300px; height: 60px; border: 1px solid #000; margin: 50px auto; font-size: 50px; font-weight: bold; text-align: center; line-height: 60px; /* -webkit-background-clip: text; 寫在background上面則clip不生效*/ background: -webkit-linear-gradient(red,blue); -webkit-background-clip: text; /*寫在background屬性下面,正常*/ color: rgba(0,0,0,0);}</style></head><body> <p>你好?。?lt;/p> </body></html>

請(qǐng)問(wèn)一下,為什么 -webkit-background-clip:text;,需要寫在background屬性的后面,clip才能生效?謝謝!

問(wèn)題解答

回答1:

CSS簡(jiǎn)寫屬性:

沒有指定的值會(huì)被設(shè)置為它的初始值。這聽起來(lái)似乎本來(lái)就很合理的樣子,但這確實(shí)意味著,它將會(huì)覆蓋之前設(shè)置的值。

MDN---CSS的簡(jiǎn)寫屬性

當(dāng)-webkit-background-clip屬性寫在background屬性后面,-webkit-background-clip就覆蓋了默認(rèn)值,所以就起作用了。反之,正好相反。

回答2:

最后識(shí)別的一個(gè)就是有效的。無(wú)論是那個(gè)屬性都是一樣的。所以,一定要確保想要保留的寫在最后。

標(biāo)簽: CSS
主站蜘蛛池模板: 扶绥县| 自治县| 商丘市| 永州市| 新竹县| 门源| 南投市| 河东区| 沈阳市| 徐水县| 天祝| 商南县| 监利县| 林州市| 翼城县| 嵊泗县| 芜湖市| 都江堰市| 双鸭山市| 临高县| 新营市| 温州市| 丰都县| 巴楚县| 高台县| 十堰市| 大宁县| 万山特区| 玉环县| 二连浩特市| 香格里拉县| 裕民县| 黑水县| 刚察县| 正定县| 江源县| 大同县| 桃江县| 瑞昌市| 和硕县| 黄浦区|