目录

font

描述 (Description)

font属性是用于影响文本呈现的简写属性。

可能的值 (Possible Values)

可能的值取决于我们如何使用此属性。

  • 《font-style》 - 属性font-style的任何允许值。

  • 《font-variant》 - 属性font-variant的任何允许值。

  • 《font-weight》 - 属性font-weight的任何允许值。

  • 《font-size》 - 属性font-size的任何允许值。

  • 《font-family》 - 属性font-family的任何允许值。

  • 《line-height》 - 属性行高的任何允许值。

  • caption - 操作系统用于标题控件的字体(例如,按钮和下拉菜单)。 这是“系统字体”值之一。

  • icon - 操作系统用于标记图标的字体。 这是“系统字体”值之一。

  • menu - 操作系统在菜单中使用的字体(例如,下拉菜单和菜单列表)。 这是“系统字体”值之一。

  • message-box - 操作系统在对话框中使用的字体(例如,警告对话框)。 这是“系统字体”值之一。

  • small-caption - 操作系统用于标记小控件的字体。 这是“系统字体”值之一。

  • status-bar - 操作系统在窗口状态栏中使用的字体。 这是“系统字体”值之一。

适用于 (Applies to)

所有HTML元素。

DOM语法 (DOM Syntax)

object.style.font = "bold italic small-caps 250%/1.2 sans-serif";

例子 (Example)

以下是使用速记字体属性的示例 -

<html>
   <head>
   </head>
   <body>
      <p <b class="notranslate">style = "font:italic small-caps bold 15px georgia;"</b>>
         Applying all the properties on the text at once.
      </p>
   </body>
</html>

这将产生以下结果 -

新页面打开
↑回到顶部↑
WIKI教程 @2018