Which of the following property is used to set the text shadow around a text?

white-space
text-shadow
text-decoration
text-transform

The correct answer is B. text-shadow.

The text-shadow property is used to add one or more shadows to text. The shadows are offset from the text in the specified directions and with the specified blur radius.

The white-space property is used to control how white space is handled in a block element. The text-decoration property is used to add decorations to text, such as underlines, overlines, and strikethroughs. The text-transform property is used to change the case of text.

Here is an example of how to use the text-shadow property:

css
p {
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

This will add a shadow to the text in the paragraph, offset by 0px horizontally and 1px vertically, with a blur radius of 2px. The shadow will be 50% transparent.

Exit mobile version