Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common font properties of css

Shulou Source: shulou.com Published: 2022-06-02 07:16:52 10月04日 Update

This article focuses on "what are the common font attributes of css". Interested friends may wish to have a look at them. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the common font properties of css?"

Css commonly used font properties are: 1, "font-family" can specify the font type; 2, "font-size" can set the font size; 3, "font-style" can set the font style; 4, "font-weight"; 5, "font-variant"; 6, "font".

The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.

Css Font Properties

Property description CSSfont sets all font attributes in a declaration 1font-family specifies the font family of the text 1font-size specifies the font size of the text 1font-style defines the font style of the text 1font-variant defines the font style of the text 1font-weight specifies the weight of the font 1@font-face Allows the website to download and use other fonts beyond the "Web- safe" font 3font-size-adjust specifies the aspect value for the element 3font-stretch to shrink or stretch the current font family 3

Here is a detailed introduction to some commonly used font properties.

1. Font-family

This attribute is used to specify the font type of the text, such as Song, boldface, official script, italics, Times New Roman, and so on. The specific syntax is as follows:

{font-family:name;}

Where name is the name of the font. Such as: {font-family: Arial;}

II. Font-size

This property is used to set the size of text. The specific syntax format is as follows:

{font-size: value | xx-small | x-small | small | medium | large | x-large | xx-large | larger | smaller | lentgth | inherit;}

The meanings of these parameters are: pixel value, minimum, small, small, normal, large, large, maximum, relative font size, relative font size, percentage, inheritance.

III. Font-style

This property is used to define the style of the font, that is, the display style of the font. The specific syntax is as follows:

{font-style: normal | intalic | oblique | inherit;}

The attribute values represent the default value, italic, tilt, and inheritance, respectively.

IV. Font-weight

This attribute is used to define the weight of the font. The syntax is as follows:

{font-weight: 100,900 | bold | bolder | lighter | normal;}

The attribute values represent numeric, bold, thicker, thinner, and default, respectively.

5. Font-variant

This property is used to set the font display of uppercase letters. The specific syntax format is as follows:

{font-variant: normal | small-caps | inherit;}

The parameter values represent default values, fonts that display small uppercase letters, and inheritance.

VI. Font

This attribute can use multiple attributes at once to define a text font, which is a composite attribute of the font. The specific syntax is as follows:

{font: font-style | font-variant | font-weight | font-size | font-family;} so far, I believe you have a better understanding of "what are the common font properties of css". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Font attribute grammar commonly used text size numeric value style content parameter uppercase uppercase size letter Arial text format type weight website Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Huawei Shulou Tech Info MySQL Linux