62,046
社区成员
发帖
与我相关
我的任务
分享
a:link {color: black; text-decoration:none;}
a:visited {color: black; text-decoration:none;}
a:hover {color: black; text-decoration:underline;}
#page1 .page1{
color:red;
}
#page2 .page2{
color:red;
}
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css" />
<title>page1</title>
</head>
<body>
<div id="page1">
<a href="page1.html" class="page1">page1</a>|
<a href="page2.html" class="page2">page2</a>
</div>
</body>
</html>
page2.html
[code=HTML]<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css" />
<title>page2</title>
</head>
<body>
<div id="page2">
<a href="page1.html" class="page1">page1</a>|
<a href="page2.html" class="page2">page2</a>
</div>
</body>
</html>