在CSS3中,我們可以使用 text-shadow
屬性將陰影應(yīng)用于文本。
text-shadow
接受以逗號(hào)分隔的陰影列表應(yīng)用于文本。
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-shadow: 10px 10px 10px #CCC;
}
</style>
</head>
<body>
<h1>Text-shadow effect!</h1>
</body>
</html>
上面的代碼呈現(xiàn)如下:
在CSS3中,我們可以使用 word-wrap
屬性強(qiáng)制文本換行在一個(gè)單詞的中間。
它的可能值是
<!DOCTYPE html>
<html>
<head>
<style>
p.test {
width: 11em;
border: 1px solid #000000;
word-wrap: break-word;
}
</style>
</head>
<body>
<p class="test">
This paragraph contains a very long
word: thisisaveryveryveryveryveryverylongwooooooooooooooooooord.
The long word will break and wrap to the next line.
The long word will break and wrap to the next line.</p>
</body>
</html>
上面的代碼呈現(xiàn)如下:
CSS3中的 text-overflow
屬性確定如何向用戶發(fā)信號(hào)通知溢出的內(nèi)容。
它可以被剪裁,或顯示省略號(hào)“...”或用戶定義的字符串。
它接受以下值。
<!DOCTYPE html>
<html>
<head>
<style>
div {
white-space: nowrap;
width: 100%;
overflow: hidden; /* "overflow" value must be different from "visible" */
text-overflow: ellipsis;
}
</style>
</head>
<body>
<div>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
</div>
</body>
</html>
上面的代碼呈現(xiàn)如下:
更多建議: