• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 13. Using Style Sheets > Converting CSS to HTML

Converting CSS to HTML

CSS is a great way to control the text throughout your Web site, but not all browsers are capable of CSS. Earlier browsers will ignore CSS formatting. If you decide to use CSS, you may want to convert your page to 3.0 browser–compatible files in order to display the page with formatting as close to the CSS styles as possible. You can then use the Check Browser behavior to redirect users based on their browser version (as you did in Lesson 5). This exercise shows you how to convert from CSS to HTML tags.

In the life.html document, choose File > Convert > 3.0 Browser Compatible.

The Convert to 3.0 Browser Compatible dialog box opens.

Select CSS Styles to HTML Markup and click OK.

The converted file is opened in a new, untitled document, and your original file remains unaltered. The styles that were applied in the keepers.html document are reproduced as closely as possible using standard HTML tags. However, it is not possible to convert some types of CSS formatting to HTML tags. For example, line height (also known as leading) has no equivalent in HTML. There is no way to adjust the spacing between lines of text with the standard HTML formatting attributes. Any attributes that cannot be converted will be discarded.


After the file is converted and placed into a new document, any changes made to the original won't be reflected in the converted document. Changes made by editing the CSS styles will not appear in converted 3.0 browser–compatible documents. You will have to reconvert the original document to match the edits as closely as possible.

Save the document as life_oldbrowsers.html.

You can close all open files.


If you are proficient in writing HTML and know how to write CSS, you can create a CSS page from scratch by choosing File > New and selecting the CSS document type from the Basic Page category on the General tab. A new document will open in which Code View will be the only available viewing mode. For more information about CSS, choose O'REILLY CSS Reference from the Book drop-down menu on the Reference panel located in the Code panel group.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint