CSS是Cascading Style Sheets的縮寫,我們中文稱為「串聯樣式表」
CSS串聯樣式表教學『文字屬性一覽』
  • color : #999999; /*文字色彩*/
  • font-family : 細明體,sans-serif; /*文字字型*/
  • font-size : 9pt; /*文字大小*/
  • font-style:italic; /*文字斜體*/
  • font-variant:small-caps; /*小字體*/
  • letter-spacing : 1pt; /*字間距離*/
  • line-height : 200%; /*設定行高*/
  • font-weight:bold; /*文字粗體*/
  • vertical-align:sub; /*下標字*/
  • vertical-align:super; /*上標字*/
  • text-decoration:line-through; /*加刪除線*/
  • text-decoration:overline; /*加頂線*/
  • text-decoration:underline; /*加底線*/
  • text-decoration:none; /*刪除連結底線*/
  • text-transform : capitalize; /*首字大寫*/
  • text-transform : uppercase; /*英文大寫*/
  • text-transform : lowercase; /*英文小寫*/
  • text-align:right; /*文字靠右對齊*/
  • text-align:left; /*文字靠左對齊*/
  • text-align:center; /*文字置中對齊*/
  • text-align:justify; /*文字分散對齊*/
  • word-spacing : 5px; /*半形空格的間距*/ New
  • vertical-align屬性
  • vertical-align:top; /*垂直向上對齊*/
  • vertical-align:bottom; /*垂直向下對齊*/
  • vertical-align:middle; /*垂直置中對齊*/
  • vertical-align:text-top; /*文字垂直向上對齊*/
  • vertical-align:text-bottom; /*文字垂直向下對齊*/
文字屬性範例 ◆ 按這裡看範例效果
語法貼於<head></head>之間 <style type="text/css">
<!--
body,table{
font-size : 9pt; /*文字大小*/
font-family : 細明體,sans-serif;/*文字字型*/
color : #999999; /*文字色彩*/
text-align:center;/*文字置中對齊*/
letter-spacing : 1pt;/*字間距離*/
line-height : 200%; /*設定行高*/
}
.font{
color : #0099ff;/*文字色彩*/
font-weight:bold; /*文字粗體*/
text-decoration:underline;/*加底線*/
letter-spacing : 0pt;/*字間距離*/
}
-->
</style>
語法貼於<body></body>之間 這是文字屬性樣式.body定義的樣式顯示在這<br>
<span class="font">選擇器.font定義的樣式顯示在這裡</span><br>
<table width="300" border="2"> <tr> <td>表格table內也和body用同樣的樣式</td> </tr> </table>

綜合解說:
設定多個文字字型以分開「 , 」但有些字型名稱由多個英文字構成
字和字之間包含空白,例如 Times New Roman ,就必須用雙引號括弧起來
font-family : 細明體,sans-seri,"Times New Roman"
XHTML1.0 | CSS | Copyright © 2001-2008 by OECSPACE