How to Use CSS Cascade in Adobe Dreamweaver
Web designers can define style rules in three different places: in an external style sheet, an embedded style sheet, or inline in an element. Using external style sheets is generally the best approach as it allows you to apply a single style sheet to an unlimited number of HTML files. But there may be times when an embedded style sheet or inline style is preferred.
Embedded Style Sheets
You can use an embedded style block to apply a set of styles to an individual page. When you edit the style block, all of the styles in the page are updated. Embedded styles will override linked styles.
To create an embedded style in Dreamweaver, select "(Define in Page)" for the Rule Definition:
Generally, you should avoid using inline styles since you will not be able to reuse them in the same document or in others. They may be a quick way to add a style, but they are not always efficient in the long run, as each time you need to make an update you must go back to each tag and perform an edit. Use an inline style to apply a one-time special style directly within a tag.
Inline styles are applied directly to an element within the HTML code using the
style attribute. The value of the
style attribute is a list of one or more property-value pairs separated by semicolons. The code snippet below illustrates how inline styles are used:
To add inline styles:
- Place your cursor in the Heading 1.
- In Properties, click CSS.
- Select <New Inline Style> from the Targeted Rule menu.
- Click the Edit Rule button.
- Style the heading as desired.