Applying HTML structural attributes to inline text
Structural text attributes (also known as HTML content-based styles) let you define selected text in meaningful categories, such as text that needs special emphasis or a strong pronouncement. Web browsers vary in their interpretations for structural attributes as appropriate for their users. For example, one browser may use italics for the Emphasis attribute, while another browser may use boldface. Another browser used by the blind or physically impaired may use a loud voice. Using CSS styles in your style sheets, you can build upon these structural attributes. For example, to emphasize a word, use the Emphasis element to apply HTML structure to the text and then use a CSS style to make the word big and bold. (See Creating HTML element styles). - The Emphasis attribute is most commonly used to emphasize text. In most browsers, the selected text appears italicized.
- The Strong attribute is used for strongly emphasizing text. In most browsers, it makes the selected text bold.
- The Quotation (cite) attribute is used to identify the selected text as content taken from another source. Most browsers display quotations using a smaller font size and italics.
- The Sample attribute is used to place special emphasis on small character sequences taken out of their normal context. Most browsers display samples using a monospaced font.
- The Definition (dfn) attribute is used to define special terms or phrases, and to assist in creating a page index or glossary. Most browsers display definitions as plain text.
- The Variable (var) attribute is used most often in conjunction with the Code attribute to represent variable names or user-supplied values within the code. Most browsers display variables with an italicized monospaced font.
- The Code attribute is used for text that represents computer source code or other machine-readable content. Most browsers display code using a monospaced, teletype-style font such as Courier.
- The Keyboard (kbd) attribute is used to identify the selected text as text that is typed on the keyboard. Most browsers display keyboard entries using a monospaced font.
To apply an HTML structural attribute to text: Do one of the following: - Select the text that you want to format, and choose an option from the Type > Structure menu or the Style context menu.
- Choose a style from the Type > Structure menu and start typing. The style remains in effect even if you press Enter or Return.
To remove all existing HTML structural attributes from the selected text: Choose Type > Structure > Plain Structure.
|