示例 2 : 对齐 示例 3 : 文本修饰 示例 4 : 行间距 示例 5 : 字符间距 示例 6 : 单词间距 示例 7 : 首行缩进 示例 8 : 大小写 示例 9 : 空白格 
					属性名color 
					
				颜色的值可以采用3种方式 1. 预定义的颜色名字 比如red,gray,white,black,pink 2. rgb格式 分别代表红绿蓝的比例 rgb(250,0,255) 即表示红色是满的,没有绿色,蓝色是满的,即红色和蓝色混合在一起:紫色 3. 16进制的表示 #00ff00 等同于 rgb(0,255,0) <style>
div#colorful{
  color:pink
}
</style>
<div id="colorful">
  粉红色
</div>
 
									
								<style>
div#colorful{
  color:pink
}
</style>
<div id="colorful">
  粉红色
</div>
								
								<style>
div#left{
  text-align:left;
}
/*让div和span的边框显露出来,便于理解本知识点*/
div,span{
  border: 1px gray solid;
  margin:10px;
}
div#right{
  text-align:right;
}
div#center{
  text-align:center;
}
span#right{
  text-align:right;
}
</style>
<div id="left">
左对齐
</div>
<div id="right">
右对齐
</div>
<div id="center">
居中
</div>
<span id="right">
span看不出右对齐效果
</span>
 
								
										
									
								
							
					属性:text-decoration
 
					
				值: overline <style type="text/css">
h1 {text-decoration: overline}
h2 {text-decoration: line-through}
h3 {text-decoration: underline}
h4 {text-decoration:blink}
.a {text-decoration: none}
</style>
<h1>上划线</h1>
<h2>删除效果</h2>
<h3>下划线</h3>
<h4>闪烁效果,大部分浏览器已经取消该效果</h4>
<a href="https://how2j.cn/">默认的超链</a>
<a class="a" href="https://how2j.cn/">去掉了下划线的超链</a>
 
									
								<style type="text/css">
h1 {text-decoration: overline}
h2 {text-decoration: line-through}
h3 {text-decoration: underline}
h4 {text-decoration:blink}
.a {text-decoration: none}
</style>
<h1>上划线</h1>
<h2>删除效果</h2>
<h3>下划线</h3>
<h4>闪烁效果,大部分浏览器已经取消该效果</h4>
<a href="https://how2j.cn/">默认的超链</a>
<a class="a" href="https://how2j.cn/">去掉了下划线的超链</a>
								
								
					属性:line-height
 
					
				值:数字或者百分比 <style>
p{
  width:200px; 
}
.p{
  line-height:200%;
}
</style>
<p>
默认行间距
默认行间距
默认行间距
默认行间距
默认行间距
默认行间距
默认行间距
默认行间距
默认行间距
默认行间距
默认行间距
默认行间距
默认行间距
</p>
<p class="p">
200%行间距
200%行间距
200%行间距
200%行间距
200%行间距
200%行间距
200%行间距
200%行间距
200%行间距
200%行间距
200%行间距
</p>
 
								
										
									
								
							
					属性:letter-spacing
 
					
				值: 数字 <style>
p{
  width:200px; 
}
.p{
  letter-spacing:2;
}
</style>
<p>
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg
</p>
<p class="p">
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg 
</p>
 
									
								<style>
p{
  width:200px; 
}
.p{
  letter-spacing:2;
}
</style>
<p>
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg
</p>
<p class="p">
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg 
</p>
								
								
					属性:word-spacing
 
					
				值: 数字 <style>
p{
  width:200px; 
}
.p{
  word-spacing:10;
}
</style>
<p>
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg
</p>
<p class="p">
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg 
</p>
 
									
								<style>
p{
  width:200px; 
}
.p{
  word-spacing:10;
}
</style>
<p>
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg
</p>
<p class="p">
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg 
</p>
								
								
					属性:text-indent
 
					
				值: 数字 <style>
p{
  width:200px;
}
.p{
  text-indent:50;
}
</style>
<p>
没有缩进效果的一段文字没有缩进效果的一段文字没有缩进效果的一段文字没有缩进效果的一段文字
</p>
<p class="p">
有缩进效果的一段文字有缩进效果的一段文字有缩进效果的一段文字有缩进效果的一段文字有缩进效果的一段
文字
</p>
 
									
								<style>
p{
  width:200px;
}
.p{
  text-indent:50;
}
</style>
<p>
没有缩进效果的一段文字没有缩进效果的一段文字没有缩进效果的一段文字没有缩进效果的一段文字
</p>
<p class="p">
有缩进效果的一段文字有缩进效果的一段文字有缩进效果的一段文字有缩进效果的一段文字有缩进效果的一段
文字
</p>
								
								
					属性:text-transform
 
					
				值: uppercase 全部大写 capitalize 首字母大写 lowercase 全部小写 <style>
p.u {text-transform:uppercase}
p.c {text-transform:capitalize}
p.l {text-transform:lowercase}
</style>
<p class="u">
abcD
</p>
<p class="c">
abcD
</p>
<p class="l">
abcD
</p>
 
									
								<style>
p.u {text-transform:uppercase}
p.c {text-transform:capitalize}
p.l {text-transform:lowercase}
</style>
<p class="u">
abcD
</p>
<p class="c">
abcD
</p>
<p class="l">
abcD
</p>
								
								<style>
p.n {white-space:normal}
p.p {white-space:pre}
p.pw {white-space:pre-wrap}
p.nw {white-space:nowrap}
</style>
<p class="n">
在默认情况下,多个     空白格或者
换行符
    会被     合并成一个空白格
</p>
<p class="p">
保留所有的    空白格
以及换行符 
相当于pre元素
特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字
</p>
<p class="pw">
保留所有的    空白格
以及换行符 
相当于pre元素
特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字特别长的一段文字
</p>
<p class="nw">
不会换行
不会换行
不会换行
不会换行
不会换行
不会换行
直到br<br/>才换行
</p>
 
								
										
									
								
							
				HOW2J公众号,关注后实时获知最新的教程和优惠活动,谢谢。
			 
			 
			
			
			
			
			
		
		提问已经提交成功,正在审核。 请于 我的提问 处查看提问记录,谢谢	
	 
 |