Home  >  Article  >  Web Front-end  >  What are the css text attributes?

What are the css text attributes?

coldplay.xixi
coldplay.xixiOriginal
2021-03-01 15:04:0912810browse

css text attributes: 1. margin paragraph spacing; 2. [text-align] text centering; 3. [text-indent] paragraph indent; 4. [text-decoration] set text decoration effect; 5 , [line-height] sets the paragraph line height.

What are the css text attributes?

The operating environment of this tutorial: windows10 system, css3 version, DELL G3 computer. This method is suitable for all brands of computers.

css text properties:

1. CSS text properties: conversion of uppercase and lowercase letters in text—text-transform

Attribute value:

  • uppercase;(all uppercase)

  • lowercase;(all lowercase)

  • Capitalize; (in all lowercase words, the first letter is capitalized)

  p{text-transform:uppercase;}

2. CSS text attribute text centering——text-align

Attribute value:

  • center; (centered)

  • left; (left aligned)

  • Right (right alignment)

  p{text-align:center;}

3. Paragraph indentation of css text attributes—text-indent

em (so The unit is words), ± can be used

  p{text-indent:3em;}

4. Set the text decoration effect of css text attributes——text-decoration

Attribute value:

  • none(remove underline)

  • underline(underline)

  • ## overline(add underline)

  • Line-through (strikethrough)

  •   a{text-decoration:none;}
5. Setting the paragraph line height of css text attributes—

-line-height

Attribute values: percentage, px, number

  a{line-height:13px;}

6. Setting the word spacing of css text attributes

Word-spacing (only useful for English)

Letter-spacing (both Chinese and English are acceptable)

  p{letter-spacing:16px;}

7. Paragraph spacing of css text properties-

margin

  p{margin:66px;}

8. CSS text properties of Border——

border

There are three attribute values: size, color, style;

The border styles are: solid (solid line), dashed (dashed line), dotted ( Dotted line)

  p{border:3pxlightgreensolid;}

9. CSS text attribute space——

white-space

Attribute value:

  • pre ;(Same as default)

  • nowrap;(Text will not wrap automatically)

  • inherit;(Inherit from parent)

  • normal;(display one)

  •   p{white-space:pre;}
10. Setting the input method status of css text attributes-

ime-mode

Attribute value:

  • auto; default

  • active; activate local language input method;

  • inactive: activate non-local language input method;

  • disabled; prohibit input method, cannot input Chinese characters

Recommended (free): css video tutorial

The above is the detailed content of What are the css text attributes?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn