WD2000: How to Create Cascading Style Sheets in Word 2000 (235481)



The information in this article applies to:

  • Microsoft Word 2000

This article was previously published under Q235481

SUMMARY

This article describes how to create external and embedded cascading style sheets (CSS).

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

NOTES

  • To use the full functionality of cascading style sheets, you need a browser that can support them, such as Microsoft Internet Explorer 4.0 or later.
  • Some browsers only support certain aspects of cascading style sheets.
  • Your results may differ, depending on the browser you are using.
  • Do not use themes for this demonstration, or the examples will not work properly.

External Style Sheets

To create an external style sheet, follow these steps:
  1. In Word, create a new Web Page (on the File menu, click New, click Web Page, and then click OK). Name it "Style" (without the quotation marks).
  2. On the View menu, click Web Layout.
  3. On the File menu, click New, click Blank Document, and then click OK. Word creates a new blank page to record your style sheet.
  4. Type the following:
       body
       {
       background-color: white
       }
       h1 
       {
       font-size: 12pt;
       font-family: "Arial";
       color: black
       }
    
       p  
       {
       font-size: 10pt;
       font-family: "Times New Roman";
       color: black
       }
    
       a 
       {
       text-decoration: none;
       font-weight: bold;
       color: black
       }
    					
  5. On the File menu, click Save As. Select the location where you want to save. In the File Name box, type MyStyles.css.
  6. Under Save as type, click Text Only, and click OK.
To Link Your Style Sheet to a Word Document:
  1. Create a new Web page in Word. (On the File menu, click New, and then click Web Page.)
  2. On the View menu, click HTML Source.
  3. Add the following to your Web page, within the "HEAD" tag:
    <HEAD>
    <TITLE>Title of article</TITLE>
    <WWLINK REL=STYLESHEET
    HREF="http://internet-name/MyStyles.css"
    TYPE="text/css">
    </HEAD>
    					
  4. On the File menu, click Exit. Answer Yes when prompted to save changes.

Embedded Style Sheets

To create an embedded style sheet, follow these steps:
  1. In Web Layout view, create a new Web page.
  2. On the Format menu, click Style.
  3. In the List box, click All styles.
  4. In the Styles list, select HTML Preformatted and click Modify.
  5. In the Modify Style dialog box, click Format, and then click Font.
  6. Format the font and click OK. For example, click Italic under Font style and click OK.

    NOTE: Click to select Add to template if you want this style sheet to be available for every document.
  7. Click OK again, and then click Apply.
  8. If everyone in your viewing audience uses a browser that supports cascading style sheets, you need to select the Rely on CSS for font formatting check box. To select this, follow these steps:

    1. On the Tools menu, click Options, and then click the General tab.
    2. Click Web Options, and then click the General tab.
    3. Select the Rely on CSS for font formatting check box.
NOTE: To use this style sheet later, in the Styles list, select HTML Preformatted.

For additional information about cascading style sheets, click the article number below to view the article in the Microsoft Knowledge Base:

235479 WD2000: What Are Cascading Style Sheets?


Modification Type:MajorLast Reviewed:6/17/2005
Keywords:kbinfo KB235481