css基础--文字与排版样式

长度font-style字体效果属性:

● 相对类型:是指相对于该属性前一个属性的单位值为基础,来完成目前的设置。而

    浏览器内常用且支持的两种长度单位,是以相对类型出现。

    ◆em相对于字符的高度

设置以目前元素所使用字体的高度为单位,例如:H1{margin:2em}是目前字符高度的两倍。

    ◆Px像素(piexl)

      设置以象素为单位,例如:H1{font-size:20px}

● 绝对类型:绝对类型所使用的单位,将不会随着显示设备的不同而改变,换句话说,

    属性值使用绝对单位时,不论在哪种设备上显示都是一样的,如:屏幕上的1cm与

    打印机上的1cm是一样长的。浏览器所支持的绝对类型的长度单位:

    In     Inches,英寸。        1 in =2.54 cm

   Cm   Centimeters,厘米。

 Mm   Millimeters,毫米。

 Pt     Points,点数。        1 pt=1/72 in

    Pc    Pocas,为印刷单位。1 pc =12 pt

 

文字样式

font-family字体设置属性:

    font-family: 宋体,楷体。。。。。, <st1:country-region w:st="on"><st1:place w:st="on">Georgia</st1:place></st1:country-region>, 'Times New Roman', Times,serif

     font-style: normal | italic(斜体) | oblique(歪斜体)

font-variant文字变体属性:

       font-variant:normal | small-caps(第一个显大)

font-weight字体粗细属性:

       font-weight:normal|bold|bolder|lighter|100-900

font-size文字大小属性:

       font-size:绝对大小|相对大小

    eg)绝对大小

       {font-size:30pt}

       {font-size: xx-small | x-small | small | medium | large | x-large | xx-large}

    eg)相对大小

       {font-size:200%}

       {font-size:2em}

font文字属性:

       font: font-family ||font-style ||font-variant ||font-weight ||font-size

 ("||"表示同时的意思)

eg) {font: font-style:20pt;font-size:italic}

 

text-decoration文字效果属性:

       text-decoration: underline | overline | line-through | blink(闪烁) | none

text-transform文字转换属性:

       text-transform: capitalize(用大写书写)|uppercase(大写字母的)|lowercase( 小写字体的) | none

 

排版样式

text-indent首行缩进 属性  

       text-indent:长度单位|百分比单位

letter-spacing字符间距属性

       letter-spacing:normal|长度单位

     eg){letter-spacing:5pt}加宽5pt

           {letter-spacing:-1pt}紧缩1pt

Word-spacing 单词间距属性

     eg)word-spacing: .15em; 加宽0.15em

style=”line-height:180%; word-spacing:.15em; letter-spacing:.1em;”

line-height行距属性

       line-height:normal|比例|长度单位|百分比

text-align水平对齐属性

       text-align:left |right |center |justify(左右对齐)

vertical-align垂直对齐属性

       vertical-align:baseline(默认)|sub(文字以下标显示)|super(文字以上标显示)|top(垂直向上对齐)|text-top(文字垂直向上对齐)|middle(垂直居中对齐)|bottom(垂直向下对齐)|text-bottom(文字垂直向下对齐)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值