Home >Web Front-end >CSS Tutorial >What are the css text attributes? Introduction to css text properties
What are the text attributes in css styles? What are the uses of each css text attribute? This article will give you an introduction to CSS text attributes (with code). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
1. CSS text attribute 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. The text of css text attribute is centered - text-align
Attribute value:
center;(center)
left;
right (right alignment)
p{ text-align:center;}3. Paragraph indentation of css text attribute—text-indent
em (in words), ± can be used
p{ text-indent: 3em;}4. css text attribute setting text decoration effect——text-decoration
Attribute value:
none (remove underline)
Underline (plus line)
overline (add underline)
line-through (strikethrough)
a{ text-decoration:none;}5.css text attribute setting paragraph line height—line-height
Attribute value: percentage, px, number
a{ line-height:13px;}6. css text attribute setting word spacing
word-spacing (only valid for English)
letter-spacing (both Chinese and English)
p{ letter-spacing: 16px;}7.css text attribute paragraph spacing-margin
p{ margin: 66px;}8.css text attribute border - border
There are three attribute values: size, color, style;
Border styles include: solid (solid line), dashed (dashed line), dotted (dotted line)
p{ border:3px lightgreen solid;}9.css text attribute space——white-space
Attribute value:
pre
Nowraw; (text does not automatically change line)
Inherit; (Inherit the Father's Ben)
normal; (display one)
p{ white-space: pre;}
auto;Default
active; Activate local language input method;
inactive: activate non-local language input method;
disabled; prohibit input method, cannot input Chinese characters
Related recommendations:
The above is the detailed content of What are the css text attributes? Introduction to css text properties. For more information, please follow other related articles on the PHP Chinese website!