CSS3 文本效果

CSS3 文本效果

CSS3中包含幾個新的文本特徵。php

在本章中您將瞭解如下文本屬性:css

  • text-shadowhtml

  • word-wrapcss3


瀏覽器支持

Internet Explorer 10, Firefox,Chrome, Safari, 和 Opera支持text-shadow 屬性。瀏覽器

全部的主流瀏覽器支持自動換行(word-wrap)屬性。this

注意: Internet Explorer 9及更早IE版本不支持 text-shadow 屬性.spa


CSS3的文本陰影

CSS3中,text-shadow屬性適用於文本陰影。code

Text shadow effect!

您指定了水平陰影,垂直陰影,模糊的距離,以及陰影的顏色:orm

給標題添加陰影:
h1
{
text-shadow: 5px 5px 5px #FF0000;
}

CSS3的換行

若是某個單詞太長,不適合在一個區域內,它擴展到外面:htm

This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.

CSS3中,自動換行屬性容許您強制文本換行 - 即便這意味着分裂它中間的一個字:

This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.

CSS代碼以下:

容許長文本換行:
p {word-wrap:break-word;}

原文地址:http://www.phplearn.cn/css3/css3-text-effects.html

相關文章
相關標籤/搜索