CSS文本

概念:CSS文本属性可定义文本外观

   通过文本属性,可以改变文本的颜色、字符间距、对齐文本、装饰文本、对文本缩进

属性 描述
color 文本颜色
direction 文本方向
line-height 行高
letter-spacing 字符间距
text-align 对齐元素中的文本
text-decoration 向文本添加修饰
text-indent 缩进元素中文本的首行
text-transform 元素中的字母
unicode-bidi 设置文本方向
white-space 元素中空白的处理方式
word-spacing 字间距
<!--index.html-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<p id="p_hello">hello CSS</p>
<div>
<h3>静夜思</h3>
<p>窗前明月光,</p>
<p>窗前明月光。</p>
<p>窗前明月光,</p>
<p>窗前明月光。</p>
</div> <div>
<p id="p_transform1">This Is A Test</p>
<p id="p_transform2">this is a test</p>
<p id="p_transform3">this is a test</p>
</div> <div>
<h1>test shadow!</h1>
<p id="wrap">test wrap!test wrap!test wrap!test wrap!test wrap!test wrap!test wrap!test wrap!</p>
</div>
</body>
</html>
/*style.css*/
#p_hello{
color: brown;
text-align: center;
} h3{
text-indent: 0.5em;
} #p_transform1{
text-transform:lowercase ; /*全部小写*/
}
#p_transform2{
text-transform: uppercase; /*全部大写*/
}
#p_transform3{
text-transform: capitalize; /*首字母大写*/
} h1{
text-shadow: 5px 5px 5px #ff0000;
} #wrap{
width: 100px;
text-wrap:normal ;
}
/*
h-shadow 必需。水平阴影的位置。允许负值。
v-shadow 必需。垂直阴影的位置。允许负值。
blur 可选。模糊的距离。
color 可选。阴影的颜色。
*/

运行结果:

最新文章

  1. Service服务
  2. PostgreSQL模仿Oracle的instr函数
  3. 牛人整理分享的面试知识:操作系统、计算机网络、设计模式、Linux编程,数据结构总结 转载
  4. [转]用NPOI操作EXCEL--数据有效性
  5. 集合对象(NSSet)
  6. PBS
  7. Java Bean 获取properties文件的读取
  8. Java学习----设计正真的应用程序
  9. Repeater实现数据绑定
  10. 配置php中的Oracle扩展
  11. 升级3.2.3后 could not find driver
  12. Objective-C日记-Bounds和Frame
  13. linux系统连接的概念及删除原理
  14. 从0开始的Python学习008变量
  15. 基于面向方面和UML的实时系统建模研究
  16. 有限状态机FSM
  17. git修改文件夹名字
  18. pythonclass,day1-day2.
  19. 图的遍历——DFS(矩形空间)
  20. chrome platform

热门文章

  1. JavaSE-2018.12.20更新
  2. ExcelUploadUtil
  3. web h5常用代码总结
  4. Javascript 4.4
  5. 数据看板superset在Windows环境下安装
  6. js原型链的深度理解!
  7. django-枚举类型扩展方法
  8. 引擎设计跟踪 地形LOD的改进
  9. maven依赖冲突
  10. org.apache.commons等常用工具学习