<tagname style="property:value;">
CSS的性質 數值
背景顏色
在body中設定性質background-color 可以改變整體背景顏色
<body style="background-color:powderblue;">
文字顏色
CSS性質用color改變文字顏色
<h1 style="color:blue;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>
字型
使用font-family改變文字字型
<h1 style="font-family:verdana;">This is a heading</h1>
<p style="font-family:courier;">This is a paragraph.</p>
<p style="font-family:courier;">This is a paragraph.</p>
字體大小
使用font-size改變字體大小
<h1 style="font-size:300%;">This is a heading</h1>
<p style="font-size:160%;">This is a paragraph.</p>
<p style="font-size:160%;">This is a paragraph.</p>
改變文字位子(偏左偏右置中)
text-align 來指定字在文章中位置
<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>
<p style="text-align:center;">Centered paragraph.</p>
改變文字格式
以下為不同的文字格式
方式為<格式>文字</格式>
<strong>This text is strong</strong>
<b> - 粗體字
<strong> - 加強重要
<i> - 斜體
<em> - 加強重要
<mark> - 標線
<small> - 縮小
<del> - 刪除
<ins> - 底線
<sub> - 下標
<sup> - 上標
沒有留言:
張貼留言