字型加陰影製作效果怎麼用css屬性實現?(代碼示範)

來源:互聯網
上載者:User
本篇文章給大家介紹,css好看的字型樣式的效果展示。希望對有需要的朋友有所協助。

css字型陰影製作效果一具體程式碼範例如下:

<!DOCTYPE HTML><html lang="en"><head>    <title>css字型陰影測試一</title>    <meta charset="UTF-8">    <style type="text/css">        h3.a {text-shadow: 0.1em 0.1em 0.05em #333 }        h3.b {text-shadow: 0.1em 0.1em 0.2em black}    </style></head><body><h3 class="a">css好看的字型樣式之陰影製作效果</h3><h3 class="b">css好看的字型樣式之陰影製作效果</h3></body></html>

以上代碼效果如下如:

css字型陰影製作效果二具體程式碼範例如下:

<!DOCTYPE HTML><html lang="en"><head>    <title>css字型陰影測試一</title>    <meta charset="UTF-8">    <style type="text/css">        h3{color: #1b5c16;}        h3.a {text-shadow: -1px -1px white, 1px 1px #333}        h3.b {text-shadow: 1px 1px white, -1px -1px #444}    </style></head><body><h3 class="a">css好看的字型樣式之陰影製作效果</h3><h3 class="b">css好看的字型樣式之陰影製作效果</h3></body></html>

以上代碼效果如:

註:所有主流瀏覽器都支援 text-shadow 屬性。Internet Explorer 9 以及更早版本的瀏覽器不支援 text-shadow 屬性。

text-shadow 屬性向文本添加一個或多個陰影。該屬性是逗號分隔的陰影列表,每個陰影有兩個或三個長度值和一個可選的顏色值進行規定。省略的長度是 0。

其屬性可能值:

h-shadow 必需。水平陰影的位置。允許負值。

v-shadow 必需。垂直陰影的位置。允許負值。

blur 可選。模糊的距離。

color 可選。陰影的顏色。

相關文章

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.