The text
property in CSS is a shorthand property that sets the text-related properties for an element in a single declaration.
Here is an example of how to use the text
property:
p {
text: bold italic underline;
}
In this example, the text
property sets the font weight to bold, the font style to italic, and the text decoration to underline for the <p>
element.
The text
property can also accept additional values to set the text-related properties for the element separately.
p {
text-align: center;
text-decoration: underline;
text-transform: uppercase;
text-shadow: 1px 1px 2px black;
}
In this example, the
text-align
property sets the alignment of the text, the text-decoration
property sets the text decoration, the text-transform
property sets the text transformation, and the text-shadow
property sets the shadow of the text.
0 Comments