Posted on 2008-10-28 20:10
胡娟 閱讀(213)
評論(0) 編輯 收藏
一 鍵入外部樣式表文件
先定義外部樣式表文件(all.css)
h1 {font: 15pt/17pt "Arial"; font-weight: bold; color: red}
h2 {font: 13pt/15pt "Arial"; font-weight: bold; color: blue}
再在basic.html中使用link對象
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.3395" name=GENERATOR>
<link rel=stylesheet href="F:"CSS"all.css" type="text/css">
</HEAD>
<BODY>
<h1>您好!!!</h1>
<p>春天花園芙蓉閣</p>
</BODY>
注意,style對象的type屬性設置為"text/css",是允許不支持這類型的瀏覽器忽略樣式表單。
2. 定義內部樣式塊對象
在basic.html文檔的<HTML>和<BODY>標記之間插入一個<STYPE>…<STYPE>塊對象。
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.3395" name=GENERATOR>
<style type="text/css">
<!--
body {font: 10pt "Arial"}
h1 {font: 15pt/17pt "Arial"; font-weight: bold; color: red}
p {font: 10pt/12pt "Arial"; color: green}
-->
</style>
</HEAD>
<BODY>
<h1>你好 </h1>
<p> 春天花園芙蓉閣</p>
</BODY>