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 text-related attributes in CSS

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article is to share with you about what the text-related attributes are in CSS. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Text size {font-size:12px/14px/16px}

Description:

1) when the attribute value is numeric, you must add units to the attribute value, except when the attribute value is 0.

2) the unit can also be pt,9pt=12px

3) in order to reduce the difference of font display between systems, the browser makers of IENetscapeMozilla held a meeting in 1999 and jointly determined that 16px/ppi is the default value of standard font size, namely 1em. By default, the multiples of 1emails 16pxrem 0.75embranch12pxplace1rem relative to the root element

4) use absolute size keywords

Xx-small=9px

X-small=11px

Small=13px

Medium=16px

Large=19px

X-large=23px

Xx-large=27px

Text color {color:white}

It is said that the color value is represented in hexadecimal:

0123456789

0123456789ABCDEF

Color mode:

Light and color mode RGB

FF0000

Abbreviation of color value:

When three sets of numbers representing three primary colors are the same at the same time, they can be abbreviated to three digits.

When representing color values in hexadecimal, you need to precede the color values with "#"

Text font {font-family: "font 1", "font 2"}

Description:

* quotation marks are required when the font is a Chinese font

* use quotation marks such as "TimesNewRoman" when there are spaces in English fonts

Under the Windows Chinese operating system, the default font in Chinese is Song style or Neo-Song style, and the default English font is Arial.

Bold {font-weight:bold/normal/100-900}

Tilt {font-style:italic/oblique}

1) in the css specification, the font weight is divided into nine levels, ranging from 100to 900, respectively.

100 corresponds to the lightest font distortion, while 900 corresponds to the heaviest font distortion.

100-500 regular font 600-900 bold font

Alignment mode

Horizontal / Vertical:

{text-align:left/right/center/justify (justify is not compatible with individual browsers)

{vertical-align:top/bottom/middle/baseline;} (only inline-block (resizable, default on one line) element type is supported)

Row height

Description:

1) when the line height of a single line of text is equal to the height of the container, the single line of text can be aligned vertically in the container.

2) when the line height of a single line of text is less than that of the container, the vertical alignment of the single line of text in the container can be realized.

3) when the line height of a single line of text is greater than that of the container, the single line of text can be aligned anywhere below vertically in the container. (there is a browser compatibility problem with IE6 and below)

Thank you for reading! This is the end of this article on "what are the text-related attributes in CSS?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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