css文本样式及控制文本的大小写

时间:2023-03-09 18:42:43
css文本样式及控制文本的大小写

常用文本样式如下:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>text文本样式</title>
<style>
h3{
/*text-indent:首行缩进*/
text-indent: -2em;
padding-left:2em;
/*text-shadow:必需。水平阴影的位置。允许负值。
必需。垂直阴影的位置。允许负值。
可选。模糊距离
可选。阴影颜色*/
text-shadow: 5px 5px 1px red;
}
p{
padding-left: 2em;
/*text-wrap规定文本换行标准,配合width使用*/
width:200px;
text-wrap: normal;
}
#p1{
/*text-transform属性控制文本的大小写*/
/*capitalize首写字母大写*/
text-transform: capitalize;
}
#p2{
/*lowercase全部小写*/
text-transform: lowercase;
}
#p3{
/*uppercase全部大写*/
text-transform: uppercase;
}
</style>
</head>
<body>
<h3>title</h3>
<p id="p1">this is a test text,this is a test text,this is a test text</p>
<p id="p2">this is a test text,this is a test text,this is a test text</p>
<p id="p3">this is a test text,this is a test text,this is a test text</p>
</body>
</html>