第1个回答 2015-09-10
先建个css.css文件存根目录下,内容如下:
.css {
font-family: "宋体";
font-size: 9px;
color: #000;
}
.css01 {
color: #000;
font-size:12px;
font-weight:bold;
font-family: "华文楷体";
}
a.css01:link { color: #333;text-decoration: none;}
a.css01:visited {text-decoration: none; color: #666;}
a.css01:hover { text-decoration: underline;color: #000;}
a.css01:active {text-decoration: none;color: #00397f;}
.css02 {
color: #00397f; font-weight:bold
}
a.css02:link {color: #00397f;text-decoration: none;}
a.css02:visited {text-decoration: none;color: #00397f;}
a.css02:hover {text-decoration: underline;color: #00397f;}
a.css02:active {text-decoration: none;color: #00397f;}
再在引用页内编写如下:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>css外部引用</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body class="css">
<p>默认字体</p>
<p class="css02">更改过的字体</p>
<p><a href="#" class="css01">连接1</a></p>
<p><a href="#" class="css02">连接2</a></p>
<p></p>
</body>
</html>