After completing this topic, you will be able to work with style inheritance.
Steps:
The Document style contains the formatting for the document body element.
The Style Inspector shows that the Document style currently specifies the attributes for the text color, font, and font size only.
Step 1We have selected the paragraph style, which is named Default Paragraph.
The Style Inspector shows that the text color, font, and font size attributes are inherited from the document body style.
Notice that the paragraph style has inherited 10 points of before and after spacing defaults from the browser. The size of the before and after spacing based on the font size.
Step 2Select the Document style.
Click the Document header.
Step 3Change the document body font size to 18 points.
Click the Font Size button.
Step 4Click the 18 list item.
Step 5Notice that the font has also changed for the Default Paragraph style.
Since the paragraph style does not have a separate font size setting, it continues to inherit the font size from the document body style.
Notice the change to the before and after spacing inherited from the browser defaults. The spacing adjusts to the font size.
Step 6Add a Text style to the style sheet.
Click the Add Style button.
Step 7Click the Text list item.
Step 8We have named the style Text 1.
Text styles also inherit their initial attributes from the document body style.
Step 9Undo the last two changes.
Click the Undo Add Style - Link button.
Step 10Click the Undo Font Size button.
Step 11You can break inheritance by changing the inherited attribute. Change the before and after spacing attributes that are inherted from the browser defaults.
Click the Spacing button.
Step 12Although the Style Inspector shows that the Default Paragraph style applies 10 points of before and after spacing for paragraphs, those values do not appear in the Spacing dialog box because those attributes are inherited from the browser defaults.
You need to use the Style Inspector to identify all of the attributes affecting a style.
Break the 10 point inheritance by specifying 6 points of before and after spacing.
Step 13We have specified 6 points of Before and After spacing. Save the changes.
Click the OK button.
Step 14The Style Inspector shows 6 points of before and after spacing directly applied to the paragraph style.
Step 15Add another paragraph style.
Click the Add Style button.
Step 16Click the Paragraph list item.
Step 17We have named the new paragraph style P2.
Although you can change it, the first style of an element is created as the default style for the element. New styles of the same element are created as non-default styles.
Non-default styles inherit the attributes that are directly set for the default style for that element. In this case, the non-default P2 style inherits the before and after spacing from the Default Paragraph style.
Step 18Change the attributes for the P2 style.
Click the Italic button.
Step 19Click the Bold button.
Step 20We have also applied a Lucida, Sans Unicode font to the P2 style
The Style Inspector shows the font, italic and bold attributes that have been directly applied to the P2 style.
It also shows the attributes inherited from the default document body style and the default paragraph style.
Step 21You can remove direct formatting from a style. Remove the bolding from the P2 style
Click the Bold button.
Step 22Select the Default Paragraph style.
Click the Default Paragraph header.
Step 23Restore the before and after spacing inheritance by removing the spacing you applied to the Default Paragraph style.
Click the Spacing button.
Step 24Delete the 6 points of Before spacing.
Press [Delete].
Step 25Select the After spacing.
Double-click in the After field.
Step 26Delete the 6 points of After spacing.
Press [Delete].
Step 27Save the changes.
Click the OK button.
Step 28Removing the direct formatting restores the inheritance from the browser.
Step 29After completing this topic, you are able to work with style inheritance.