03-文字屬性
我是文字 我是文字
abc我是段落
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>03-文字屬性</title> <style> p{ font-style: italic; font-weight: bold; font-size: 10px; font-family:"楷體"; } </style> </head> <body> <!-- 1.規定文字樣式的屬性 格式:font-style: italic; 取值: normal : 正常的, 默認就是正常的 italic : 傾斜的 快捷鍵: fs font-style: italic; fsn font-style: normal; 2.規定文字粗細的屬性 格式: font-weight: bold; 單詞取值: bold 加粗 bolder 比加粗還要粗 lighter 細線, 默認就是細線 數字取值: 100-900之間整百的數字 快捷鍵 fw font-weight:; fwb font-weight: bold; fwbr font-weight: bolder; 3.規定文字大小的屬性 格式:font-size: 30px; 單位:px(像素 pixel) 注意點: 通過font-size設置大小一定要帶單位, 也就是一定要寫px 快捷鍵 fz font-size:; fz30 font-size: 30px; 4.規定文字字體的屬性 格式:font-family:"楷體"; 注意點: 1.如果取值是中文, 需要用雙引號或者單引號括起來 2.設置的字體必須是用戶電腦里面已經安裝的字體 快捷鍵 ff font-family:; --> <i>我是文字</i> <b>我是文字</b> <p>abc我是段落</p> </body> </html>