Styling Text

Setting text styles is one of the most important aspects of cascading style sheets, but the process is not straightforward. Here are some properties that you can use with text:

  • float— Indicates how text should flow around this element. Set this to left to move the element to the left of the display area and have text flow around it to the right, set it to right to move the element to the right and have text flow around the element to the left, or set it to none.

  • font-family— Sets the font face. (Note that you can specify a number of options here, separated by commas; the first face available on the user's system is used.)

  • font-size—— Sets the size of the text's font.

  • font-stretch— Indicates the desired amount of condensing or expanding ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.