CSS の基本チュートリアルのサイズ、フォント、テキストのプロパティ
CSS サイズ屬性
width: 要素の幅。必ず px 単位を追加してください。
height: 要素の高さ。
CSSフォントプロパティ
font-size: テキストのサイズ。例: font-size:14px;
font-family: フォント。例: フォントファミリー: Microsoft Yahei
フォントスタイル: イタリック、値: イタリック。例: font-style:italic;
font-weight:bold、value:bold。例: font-weight: 太字;
CSS テキスト屬性
color: テキストの色
text-decoration: テキスト裝飾線、値: none、underline (下線) 、オーバーライン(上線)、ラインスルー(取り消し線)
text-align: テキストの水平方向の配置、値: left、center、right
line-height: 行の高さ、固定値または割合。例: line-height:24px; line-height:150%;
text-indent: 最初の行のインデント。例: text-indent:28px;
letter-spacing: 単語(yǔ)の間隔。
例は以下の通りです
<!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>習(xí)近平心中的互聯(lián)網(wǎng)</h1> <p>互聯(lián)網(wǎng)是20世紀(jì)最偉大的發(fā)明,它正在將人類“<span class="box">一網(wǎng)打盡</span>”,人們?cè)诓恢挥X(jué)中已經(jīng)融入了互聯(lián)網(wǎng)生態(tài),互聯(lián)網(wǎng)讓世界變成了“雞犬之聲相聞”的地球村。</p> </body> </html>