microsoft.com Home   All Products  |   Support  |   Search  |   microsoft.com Home  
Microsoft

Microsoft Typography | Web... | Specifying fonts... | Linking and embedding... next


Linking and embedding style properties

CSS1 provides the designer with various ways of specifying style for a Web page.

<HTML>
<HEAD>
 <TITLE>title</TITLE>
 <LINK REL=STYLESHEET TYPE="text/css" 
   HREF="http://style.com/cool.css" TITLE="Cool">
 <STYLE TYPE="text/css">
   @import url(http://style.com/basic.css);
   H1 { color: blue }
 </STYLE>
</HEAD>
<BODY>
 <H1>Headline is blue</H1>
 <P STYLE="color: green">The paragraph is green.
</BODY>
</HTML>

This code demonstrates the different ways of specifying style within an HTML Web page.


Link

This is the most powerful way of using style sheets. The HREF points to a text file that lists style declarations. Because this style sheet file is stored separately it can influence any number of Web pages.


Style

A STYLE section in the HEAD of an HTML file, can include any number of declarations and imported style sheets using the @import notation. Declarations and @imports in the STYLE section override declarations listed in a linked style sheet.


Inline

Although it is usually best to separate style information from the actual structure of a page, it is possible to include inline style declarations within the body of an HTML page. Inline style declarations are also useful during the development of a site or page. When the layout or effects are finalized these inline style declarations can be classed and moved to a linked style sheet or the STYLE section in the HEAD of the HTML page.



this page was last updated 30 June 1997
© 1997 Microsoft Corporation. All rights reserved. Terms of use.
comments to the MST group: how to contact us

 

Microsoft Typography | Web... | Specifying fonts... | Linking and embedding... next