What are the css text attributes?

coldplay.xixi
Release: 2023-01-03 09:26:21
Original
12809 people have browsed it

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;}
Copy after login

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

Attribute value:

  • center; (centered)

  • left; (left aligned)

  • Right (right alignment)

  p{text-align:center;}
Copy after login

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

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

  p{text-indent:3em;}
Copy after login

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;}
    Copy after login
5. Setting the paragraph line height of css text attributes—

-line-height

Attribute values: percentage, px, number

  a{line-height:13px;}
Copy after login

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;}
Copy after login

7. Paragraph spacing of css text properties-

margin

  p{margin:66px;}
Copy after login

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;}
Copy after login

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;}
    Copy after login
    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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!