12文本相关属性
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title></title> 6 <style type="text/css"> 7 p{ 8 border: 1px solid red;/*给p标签加边框*/ 9 height: 50px; 10 /*让文字水平居中*/ 11 /*text-align: center;*/ 12 /*垂直居中 让line-height 等于盒子高度 line-height=height*/ 13 line-height: 50px; 14 /*首行缩进*/ 15 text-indent: 50px; 16 /*单词间距*/ 17 letter-spacing: 10px; 18 } 19 </style> 20 </head> 21 <body> 22 <p> 23 这是一个p标签 24 </p> 25 </body> 26 </html>
加个边框
水平居中
垂直居中
去掉水平居中:使用首行缩进
单词间距