Applying a class style
How you apply a class styleA style that applies to all members of a class. When you assign a class to an element, the corresponding class style (if any) is applied to it. Universal class styles can apply to any element, while element-specific class styles can only apply to elements of the specified type. to an element depends on what the element is.
If the element is one of these… |
Apply a class style by doing this: |
---|---|
|
Note that if you have defined any element-specific class styles, only those that match the current element will appear in the Style or Class menu. |
|
|
|
|
Although you can apply any universal styleA class style that can be applied to any element or element fragment. to an element fragment or an inline elementAn element that does not force line breaks before and after itself. An inline element can only exist inside a block element, such as a paragraph. Common inline elements are images and form fields., some of the style’s properties may be ignored by browsers because those properties apply only to whole block elements. For example, if a style specifies 20-pixel margins on all sides, and you apply the style to a paragraph fragment, the fragment will have 20-pixel margins on its left and right sides but not above and below. The exact behavior of such block-oriented properties when applied to an element fragment depends on the browser.
Some block-oriented style properties do not display correctly in Edit mode when applied to an inline elementAn element that does not force line breaks before and after itself. An inline element can only exist inside a block element, such as a paragraph. Common inline elements are images and form fields. or element fragment. To view these properties, switch to Preview mode.