1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title></title> 6 <!--CSS文本设置:--> 7 <!--color:设置文字的颜色,如:color:red;--> 8 <!--font-size:设置文字的大小,如:font-size:12px;--> 9 <!--font-family:设置文字的字样,如font-family:"微软雅黑";--> 10 <!--font-style:设置文字是否倾斜,如font-style:'normal';设置不倾斜。font-style:'italic';设置文字倾斜;--> 11 <!--font-weight:设置文字的加粗,如:font-weight:bold;设置加粗。font-weight:normal;设置不加粗--> 12 <!--line-height:设置文字的行高,如:line-height:24px;--> 13 <!--text-decoration:设置文字的上中下划线,如text-decoration:none;将文字划线去掉--> 14 <!--text-indent:设置文字首行缩进,如:text-indent:24px;设置文字首行缩进24px--> 15 <!--text-align:设置文字水平对齐方式,如text-align:center;设置文字水平居中--> 16 <style type="text/css"> 17 .text{ 18 font-family: "微软雅黑"; 19 font-size: 16px; 20 color: #369; 21 font-style: italic; 22 font-weight: bold; 23 line-height: 20px; 24 line-break: normal; 25 /*....*/ 26 } 27 </style> 28 </head> 29 <body> 30 <div class="text"> 31 CSS文本设置: 32 color:设置文字的颜色,如:color:red; 33 font-size:设置文字的大小,如:font-size:12px; 34 font-family:设置文字的字样,如font-family:"楷体"; 35 font-style:设置文字是否倾斜,如font-style:'normal';设置不倾斜。font-style:'italic';设置文字倾斜; 36 font-weight:设置文字的加粗,如:font-weight:bold;设置加粗。font-weight:normal;设置不加粗 37 line-height:设置文字的行高,如:line-height:24px; 38 text-decoration:设置文字的上中下划线,如text-decoration:none;将文字划线去掉 39 text-indent:设置文字首行缩进,如:text-indent:24px;设置文字首行缩进24px 40 text-align:设置文字水平对齐方式,如text-align:center;设置文字水平居中 41 </div> 42 </body> 43 </html>
CSS-07-CSS文本设置
猜你喜欢
转载自www.cnblogs.com/qinqin-me/p/11250741.html
今日推荐
周排行