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 style attributes in css

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

Share

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

This article mainly shows you "what are the style attributes of Chinese text in css", the content is simple and clear, and I hope it can help you solve your doubts. Let me lead you to study and learn about "what are the style attributes of Chinese text in css".

Text css styles include: text color "color", text direction "direction", character spacing "letter-spacing", text horizontal alignment "text-align", text modification "text-decoration", first line indentation "text-indent" and so on.

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

The text css style property describes color sets the text color direction sets the text orientation. Letter-spacing sets character spacing line-height sets line height text-align text horizontal alignment text-decoration adds embellishments to text first line of text in text-indent indent elements text-shadow settings text shadows text-transform control elements letters unicode-bidi settings or returns whether text is overridden vertical-align text vertical alignment handling of white space in white-space setting elements word-spacing sets word spacing

Here are some css text styles.

Text-indent first line indent

First line indentation indents the first line of a paragraph, which is a common text formatting effect. Generally speaking, Chinese writing begins with two blank spaces, similar to this.

The value of this property is allowed to be negative.

Syntax:

Text-indent: | | inherit

Tip: the initial value is 0

Apply to: block-level elements (including block and inline-block)

Inheritance: yes

Percentage: relative to the width of the containing block

Case: first character sinking

Div {width: 200px; border: 1px solid black; text-indent: 0.5em;} div: first-letter {font-size: 30px; float: left;}

Text-align horizontal alignment

Horizontal alignment is the horizontal alignment that affects the text in an element.

Syntax:

Text-align: left | center | right | justify | inherit

Initial value: left

Apply to: block-level elements (including block and inline-block)

Inheritance: yes

For IE7- browsers, using text-align changes not only the horizontal alignment of text, but also the horizontal alignment of block-level elements in future generations

Word-spacing word interval

Word spacing refers to word spacing, which is used to set the spacing between words or words. In fact, "word" represents any string of non-white space characters, surrounded by some kind of white space character.

Note: words are separated by spaces, and the spacing between words = word-spacing + space size

Note: the word interval can be negative

Syntax:

Word-spacing: | normal | inherit

Initial value: normal (default is 0)

Apply to: all elements

Inheritance: yes

Letter-spacing letter spacing

Letter spacing refers to character spacing

Note: letter spacing can be negative

Letter-spacing: | normal | inherit

Initial value: normal (default is 0)

Apply to: all elements

Inheritance: yes

Text-transform text conversion

Text conversion is used to handle the case conversion of English.

Syntax:

Text-transform:uppercase (all uppercase) | lowercase (all lowercase) | capitalize (initials uppercase) | none | inherit

Initial value: none

Apply to: all elements

Inheritance: yes

Text-decoration text retouching

Text modifiers are used to provide modifiers for text.

Note: the color of the text modifier is the same as the text color.

Syntax:

Text-decoration:none | [underline (underscore) | | overline (underscore) | | line-through (dash)] | inherit

Initial value: none

Apply to: all elements

Inheritance: none

The above is all the content of the article "what are the style attributes of css text?" Thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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