XML technologies / CSS / CSS Cookbook / General principles / CSS with Microsoft Expression Web Designer

(Excerpt from “CSS Kochbuch” by Christopher Schmitt)

Problem

You use Microsoft Expression Web Designer to create web pages and want to use its CSS features too.

Solution

Like Dreamweaver, Microsoft Expression Web Designer can attach external stylesheets, create CSS files and insert style definitions, as the following three figures show.

Using Apply Styles in Microsoft Expression Web Designer to attach an external stylesheet

Figure: Use the Apply Styles tab in Microsoft Expression Web Designer to attach an external stylesheet.

Creating a CSS file in Microsoft Expression Web Designer

Figure: Creating a CSS file in Microsoft Expression Web Designer.

Managing styles in Microsoft Expression Web Designer through Manage Styles

Figure: Managing styles in Microsoft Expression Web Designer through the Manage Styles tab.

Here are several ways to add CSS to your pages:

  • To attach an external stylesheet to any page, open the tab APPLY STYLE and click ATTACH STYLE SHEET.

  • Click the icon NEW DOCUMENT and then CSS to create an empty CSS document.

  • Edit your web page like a Word document. Expression Web Designer automatically adds new style definitions to an internal stylesheet.

  • Enter style definitions through code view.

Discussion

Expression Web Designer has made great strides in CSS support compared with its predecessor, FrontPage. After defining page styles, you can view the current styles in the tab MANAGE STYLES. You can also switch between internal and external stylesheets there.

When you use the toolbar FORMATTING to style HTML content, the program automatically inserts inline style definitions into the document. Font and color instructions added this way are no longer defined in tags font as shown below, but are stored in an internal stylesheet:

<font face="georgia, times new roman, serif" color="#ff0000" size="2">This is text.</font>

Changes in FrontPage often duplicated code, as shown here:

<font face="georgia, times new roman, serif" color="#ff0000" size="2"><font face="times new roman, serif">This is text.</font></font>

This quickly bloated pages unnecessarily, and they rarely rendered correctly in browsers other than Internet Explorer. The following figure shows that Expression Web Designer no longer has these problems.

Expression Web Designer stores text styles in an internal stylesheet

Figure: When text is styled in Expression Web Designer, the program stores the definitions in an internal stylesheet.

  

 

 

 

back to top