CSS3文本属性是CSS3中的一种新特性,它可以让我们更加灵活地控制文本的样式。它可以让我们更加方便地定义文本的字体、大小、颜色、对齐方式等,还可以使用新的属性来定义文本的行高、字间距、字母间距等。
font-family: Arial; font-size: 14px; color: #000; text-align: center; line-height: 1.5; letter-spacing: 2px; word-spacing: 5px;
在CSS3中,我们可以使用 text-shadow
属性将阴影应用于文本。
text-shadow
接受以逗号分隔的阴影列表应用于文本。
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-shadow: 10px 10px 10px #CCC;
}
</style>
</head>
<body>
<h1>Text-shadow effect!</h1>
</body>
</html>
上面的代码呈现如下:
在CSS3中,我们可以使用 word-wrap
属性强制文本换行在一个单词的中间。
它的可能值是
<!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>
上面的代码呈现如下:
CSS3中的 text-overflow
属性确定如何向用户发信号通知溢出的内容。
它可以被剪裁,或显示省略号“...”或用户定义的字符串。
它接受以下值。
<!DOCTYPE html>
<html>
<head>
<style>
div {
white-space: nowrap;
width: 100%;
overflow: hidden;
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>
上面的代码呈现如下:
都说用 DIV+CSS 布局来设计网站便于优化,容易被收录,那么你对 DIV+CSS 布局的用法是否了解?CSS 布局是网页html通过 DIV 标签 ...
footer 标签一般用于网页的底部布局,表示页脚,包含与文档相关的信息。实例文档的页脚:footer pPosted by: Hege Refsnes/p pti...
HTML tbody 标签char 属性用来指定 tbody 标签内的元素该以哪个字符对齐,请参考下述例子:实例把 tbody 元素中的内容与字符 "."...
HTML style 标签通过 type 属性设置HTML样式表的 MIME 类型,请参考下述示例:实例在 style 标签中使用 type 属性:style type="...
HTML5 新的表单元素HTML5 有以下新的表单元素:datalistkeygenoutput注意:不是所有的浏览器都支持HTML5 新的表单元素,但是你可以...
HTMLbig标签 -HTML5 不支持实例让文本比常规的字体大一号:!DOCTYPE htmlhtmlheadmetacharset="utf-8"title编程狮(.cn)/title/he...
SQL TOP、LIMIT 和 ROWNUM 子句SQL TOP 子句用于从一张数据表中取回前 N 个或者 X% 的记录。注意:所有的数据库系统都不支持 TOP...
SQL SUM 函数SUM函数用于找出表中记录在某字段处的总和。要理解 SUM 函数,请考虑 employee_tbl 表,表中记录如下所示:SQL SELE...