代碼架構:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" /> //瀏覽器識別編碼的字體,以防出現亂碼
<title>在線演示 DIVCSS5</title> //標題
</head>
<body>
<font size="2">在線演示測試<font size="4">文字</font>,
歡迎訪問DIVCSS5學習網站!</font>
</body>
</html>
設置字體居中大小和字體類型
font size 用於設定字體大小
color=" " 設置字體顏色
<div style="font:12px bolder '微軟雅黑'; text-align:center;">
</div>
font family 設置字體類型
style="" 設置背景顏色為紅色
文本樣式的常用屬性
text-align 設置文本的水平對齊方式
line-height 設置行高
text-decoration 設置文本修飾效果
text-indent 設置段落的首行縮進
word-wrap 設置文本換行
color 設置文本顏色
background-color 設置文本的背景顏色
字體顏色與表格
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>font字體顏色在線實例 DIVCSS5</title>
</head>
<body>
<font color="#FF0000">我是紅色字體</font>
<table width="300" border="1">
<tr>
<td><font color="#0000FF">你好</font></td>
<td>DIVCSS5</td>
</tr>
</table>
</body>
</html>
table 表格標簽,設置表格寬度
tr 把每個元素按行分隔開
td 把同一行的元素分隔,固定格式放在“tr”后