4_常见样式-font


  1、font-size 文字大小

      (浏览器默认大小一般是16px)
  2、font-family 字体

      (先写英文字体,在写中文字体)

如:

font-family: "方正细体", "楷体", "微软雅黑", "宋体";
font-family: Arial, "楷体", "微软雅黑", "宋体";


  3、font-style 斜体

      italic 倾斜/normal 正常


  4、font-weight 加粗

      bold 加粗/normal 正常/number


  5、line-height 行高

    文字在一行中上下居中

        单位:px或者当前元素字体大小的倍数      
 
    line-height的值紧跟着font-size值使用斜杠分开,

        如:<font-size>/<line-height>

line-height: 1.4;
font: 18px/2 "宋体";


    font (集合样式)
   1. 固定顺序 (font-weight font-style font-size/line-height font-family)

   2. 必写项 (font-size font-family)

   6、color 文字颜色
      如:

font: 18px/2 "宋体";
color: red;

 

   7、 text-indent 首行缩进
            正值 从左向右移动首行文字
            负值 从右向左移动首行文字
            单位 em  1em = 当前元素的1个文字大小

    8、text-align
            文本对齐方式(left/center/right)

    9、text-decoration
            文本修饰

        (none/underline下划线/overline上划线/line-through删除线)

     10、

    word-spacing 单词间距
           letter-spacing 字母间距
如:
    

word-spacing:2px;
letter-spacing: 3px;

   11、win7中 宋体 下 英文特殊字符的宽度(如空格),是字体大小的一半
      宋体中,文字右边一般会保留1px的空隙

     两个词中间的距离 = word-spacing + 2*letter-spacing + 空格;

posted @ 2017-04-08 18:34  被选中的男人  阅读(464)  评论(0编辑  收藏  举报