WD2000: How to Create Cascading Style Sheets in Word 2000

ID: Q235481


The information in this article applies to:
  • Microsoft Word 2000


SUMMARY

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


MORE INFORMATION

Microsoft Technical Support will not resolve problems produced by editing the HTML that Word 2000 generates. This HTML Code sample is provided as a convenience for authors seeking to extend the capabilities of Word. For more information about writing HTML, please see the following Microsoft Web site:

http://msdn.microsoft.com/workshop/author/default.asp


WARNING: ANY USE BY YOU OF THE HTML PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this HTML "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

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.


  4. Word creates a new blank page to record your style sheet.
  5. Type the following:


  6. 
       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
       } 
  7. On the File menu, click Save As. Select the location where you want to save. In the File Name box, type MyStyles.css.


  8. 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:


  4. 
    <HEAD>
    <TITLE>Title of article</TITLE>
    <LINK REL=STYLESHEET
    HREF="http://internet-name/MyStyles.css"
    TYPE="text/css">
    </HEAD> 
  5. 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:
Q235479 WD2000: What Are Cascading Style Sheets?

Additional query words:

Keywords : kbdta wd2000
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: October 21, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.