Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common font properties of css

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report