CSS 樣式CSS font 文字樣式範例

CSS 文字風格樣式範例

color: #0f0f0f; /*文字顏色*/
font-family: Arial, sans-serif; /*文字風格字型*/
font-size: 13px; /*文字大小*/
font-weight: bold; /*文字粗體*/
font-style: italic; /*文字斜體*/
font-variant: small-caps; /*小字體*/
  • font-weight: normal; Andersen Danish Author Whose Fairy Tales
  • font-weight: bold; Andersen Danish Author Whose Fairy Tales
  • font-style: italic; Andersen Danish Author Whose Fairy Tales
  • font-variant: small-caps; Andersen Danish Author Whose Fairy Tales
letter-spacing: 1px; /*字體間距離*/
line-height: 18px; /*設定行高(上下行的間距)*/
  • letter-spacing: -1px; Andersen Danish Author Whose Fairy Tales
  • letter-spacing: 0px; Andersen Danish Author Whose Fairy Tales
  • letter-spacing: 1px; Andersen Danish Author Whose Fairy Tales
  • letter-spacing: 2px; Andersen Danish Author Whose Fairy Tales
text-decoration: line-through; /*加上刪除線*/
text-decoration: overline; /*加上頂線*/
text-decoration: underline; /*加上底線*/
text-decoration: none; /*刪除連結底線*/
text-transform: capitalize; /*字首大寫*/
text-transform: uppercase; /*英文大寫*/
text-transform: lowercase; /*英文小寫*/
  • text-decoration: line-through; Until My Dancing Days are Done
  • text-decoration: overline; Until My Dancing Days are Done
  • text-decoration: underline; Until My Dancing Days are Done
  • text-decoration: none; Until My Dancing Days are Done
text-align: right; /*文字靠右對齊*/
text-align: left; /*文字靠左對齊*/
text-align: center; /*文字置中對齊*/
text-align: justify; /*文字分散對齊*/
  • Andersen enjoyed considerable success with a short story titled A Journey on Foot from Holmen Canal to the East Point of Amager. He also published a comedy and a collection of poems that season. Though he made little progress writing and publishing immediately thereafter, in 1833 he received a small traveling grant from the King, enabling him to set out on the first of many journeys through Europe.
word-spacing: 5px; /*設定詞的間距(詞間需有空白)*/
  • Andersen enjoyed considerable success with a short story titled A Journey on Foot from Holmen Canal to the East Point of Amager. He also published a comedy and a collection of poems that season. Though he made little progress writing and publishing immediately thereafter, in 1833 he received a small traveling grant from the King, enabling him to set out on the first of many journeys through Europe.
word-wrap: break-word; /*任意斷字,適用於英文*/
word-wrap: nowrap; /*強制水平排序不斷行*/
vertical-align: super; /*上標字*/
vertical-align: sub; /*下標字*/
  • vertical-align: super; Stayed at Dickens home for five weeks
  • vertical-align: sub; Stayed at Dickens home for five weeks
vertical-align: top; /*垂直向上對齊*/
vertical-align: bottom; /*垂直向下對齊*/
vertical-align: middle; /*垂直置中對齊*/
vertical-align: text-top; /*文字垂直向上對齊*/
vertical-align: text-bottom; /*文字垂直向下對齊*/

Modification in