CSS3中文字鏤空和透明值以及陰影製作效果的設定

來源:互聯網
上載者:User
這篇文章主要介紹了CSS中文字鏤空、透明值、陰影製作效果設定樣本小結,其中通過text-stroke-color透明值的設定可以讓文字在某些程度上更加柔和,需要的朋友可以參考下

text-fill-color打造鏤空文字:
代碼

-webkit-text-fill-color:transparent;   -webkit-text-stroke:1px #000;

效果

text-stroke-color透明值讓文字更柔和:
代碼

background-image:-webkit-linear-gradient(#eee,#000);   -webkit-background-clip:text;   -webkit-text-fill-color:transparent;

效果1

代碼

background-image:-webkit-linear-gradient(#eee,#000);   -webkit-background-clip:text;   -webkit-text-fill-color:transparent;   -webkit-text-stroke:1px transparent;

效果2

對比你會發現效果2中的文字比效果1更柔和一點

text-shadow文字陰影
文法:

box-reflect:none | [ <length>{2,3} && <color>? ][ , <length>{2,3} && <color>? ]*

我們來實現一個有陰影的文本樣本:
代碼

text-shadow:2px 2px 0 #000;

效果

text-shadow有3個length參數,第1個表示水平位移,第2個表示垂直位移,第3個表示模糊(可選)
柔和一點的文字陰影:
代碼

text-shadow:1px 1px 5px #000;

效果

多重陰影:
代碼

text-shadow:1px 1px 5px #000;

效果

以上就是本文的全部內容,希望對大家的學習有所協助,更多相關內容請關注topic.alibabacloud.com!

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.