Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML
IMCreator - Free Website Builder

CSS font

Also see the full, alphabetical list of CSS properties


The CSS font property is a shorthand property for setting font-family, font-size, font-variant, font-style, font-weight, and line-height. This saves time and space - if you use the 'font' property, you don't need to specify each one separately.

Syntax: font: <value1> <value2> ...
Possible Values:
  • font-style
  • font-variant
  • font-weight
  • font-size/line-height
  • font-family
Initial Value: None
Applies to: All elements
Inherited: Yes
Media: Visual
Example p { font: 14pt/16pt fantasy, cursive, Serif }
Try it yourself!


System Fonts

You can also specify styles for system fonts.

ValueDescription
caption Specifies font properties for captioned controls. For example, buttons, drop-downs, etc.).
icon Specifies font properties for label icons.
menu Specifies font properties for menus. For example, dropdown menus and menu lists.
message-box Specifies font properties for dialog boxes.
small-caption Specifies font properties for labeling small controls.
status-bar Specifies font properties for window status bars.

Example:

button { font: 300 italic "Verdana", sans-serif }

Also see all CSS properties listed alphabetically


Enjoy this page?

  1. Link to this page (copy/paste into your own website or blog):
  2. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!