CSS basic tutorial size, font and text properties
CSS size attribute
width: element width, be sure to add px units.
height: Element height.
##CSS Font Properties
- font-size: text size. For example: font-size:14px;
- font-family: font. For example: font-family:Microsoft Yahei;
- font-style: italic, value: italic. For example: font-style:italic;
- font-weight: bold, value: bold. For example: font-weight:bold;
##CSS text property
- color: text color
- text-decoration: text decoration line, values: none, underline, overline, line-through (Strikethrough)
- text-align: text horizontal alignment, values: left, center, right
- line-height: line High, you can use a fixed value or a percentage. For example: line-height:24px; line-height:150%;
- text-indent: The first line is indented. For example: text-indent:28px;
- letter-spacing: word spacing.
- The examples are as follows
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> <style type="text/css"> h1{ color:red; width:350px; text-align:center; font-family:微軟雅黑; } p{ line-height:150%; text-indent:28px; font-family:楷體; } .box{ font-style:italic; font-weight:bold; text-decoration:underline; } </style> </head> <body> <h1>習近平心中的互聯網</h1> <p>互聯網是20世紀最偉大的發(fā)明,它正在將人類“<span class="box">一網打盡</span>”,人們在不知不覺中已經融入了互聯網生態(tài),互聯網讓世界變成了“雞犬之聲相聞”的地球村。</p> </body> </html>