HTML 樣式實例 – 背景顏色
background-color 屬性為元素定義了背景顏色:
<html> <body style="background-color:yellow"> <h2 style="background-color:red">This is a heading</h2> <p style="background-color:green">This is a paragraph.</p> </body> </html>

HTML樣式:好看的顏色字體是有方法的
HTML 樣式實例 – 字體、顏色和尺寸
font-family、color 以及 font-size 屬性分別定義元素中文本的字體系列、顏色和字體尺寸:
<html> <body> <h1 style="font-family:verdana">A heading</h1> <p style="font-family:arial;color:red;font-size:20px;">A paragraph.</p> </body> </html>

HTML樣式:好看的顏色字體是有方法的
HTML 樣式實例 – 文本對齊
text-align 屬性規定了元素中文本的水平對齊方式:
<html> <body> <h1 style="text-align:center">This is a heading</h1> <p>The heading above is aligned to the center of this page.</p> </body> </html>

HTML樣式:好看的顏色字體是有方法的
HTML 樣式實例 – 綜合
<html> <body> <h1 style="background-color:yellow;text-align:center">This is a heading</h1> <h2 style="background-color:red;text-align:center">This is a heading</h2> <p style="background-color:green;text-align:center">This is a paragraph.</p> <h1 style="font-family:verdana;text-align:center">A heading</h1> <p style="font-family:arial;;text-align:center;color:red;font-size:20px;">A paragraph.</p> </body> </html>

HTML樣式:好看的顏色字體是有方法的
原創文章,作者:投稿專員,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/281475.html
微信掃一掃
支付寶掃一掃