The following steps will show you how to link an external CSS to an open HTML file in dream weaver with the all media type. You?ll need a sample HTML file and a sample CSS file to do this exercise. If you don?t have sample files, feel free to download the sample HTML file for chapter 12 exercise files from this book?s companion web site see the preface for details or the lucky hair line support page. In dream weaver open the HTML file you?d like to add a CSS link to and click the attach style sheet icon at the bottom of the CSS styles panel.
Clicking the icon opens the attach external style sheet dialog box. If you don?t see the CSS styles panel, choose window CSS styles to open it. Type the name of the CSS you?d like to link to the file in the file/URL text field or click the browse button to find and select the desired CSS.If you?re using the sample files you just downloaded from the web click the browse button to navigate to the location where you saved the sample files, and select the cssdemo.css file. Click the media drop down menu and select the ALL media type.
To specify multiple media types type the names of the media types desired, separated by commas and no spaces such as screen print TTY. If desired click the dialog box?s preview button to see how the newly linked CSS file styles your sample HTML file. Click ok to complete the link. Dream weaver?s CSS file is styled with the attributes on the linked CSS. Now that you have an understanding of the differences between internal, inline and external CSS style definitions, I?ll talk about the different style selections.
You can use any of three style selectors. Though they all use roughly the same syntax for the style declarations. Each type determines which parts of the HTML will be modified. Custom class styles or simply custom styles are for times when you want to create a style and then selectively apply it to text or objects on a web page. For example, in the sentence our customized content management system makes it possible for you control and maintain your online publications you could create a custom class style to modify the words content management system.
Hare?s how the CSS style declaration would look for that custom style with a selector named. When writing the custom class styles in the CSS file be sure to include a period directly before the style name, as shown in the preceding code. The presence of the period performs two functions. First, it helps you quickly identify custom styles from other types when reviewing your CSS code. Secondly, and perhaps more importantly, the period informs browsers that the style is a custom class that will be selectively applied to content on the page. Redefining existing tags is one of the best ways to globally style content on a site without having to selectively apply the styles as you must with custom class styles.
|