我正在一个网站上工作,我想为不同的链接集制作不同的样式。我已经阅读了教程,但我仍然无法让我的代码正常工作。所以这里是代码。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
a.test: link {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 1em;
color: #C00;
}
a.test: hover {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 1em;
color: #6F0;
}
a.test: active {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 1em;
color: #90F;
}
a.test: visited {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 1em;
color: #FF0;
}
</style>
</head>
<body>
Emily
<p>sdlkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjlsdkf
sdlkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjlsdkf
sdlkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjlsdkf
sdlkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjlsdkf
<p><span class="test"><a href="http://www.ehow.com/how_2080242_style-link-css.html">rose</a>
<a href="http://www.ehow.com/how_2080242_style-link-css.html" class="test"> daisy</a>
<a href="http://www.ehow.com/how_2080242_style-link-css.html" class="test">tulip</a>
<a href="http://www.ehow.com/how_2080242_style-link-css.html" class="test"> cactus</a> </span>
<p>ldkfjsldkfjlsdkfsdlkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjs ldkfjsldkfjlsdkfsdlkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsldkfjsld
</body>
</html>
根据我的阅读,我知道我需要将一个类合并到这样的链接样式中:a.test:link
并将样式合并到链接中,您可以给它一个像这样的类,
仙人掌
而且我无法弄清楚为什么这不起作用。
谢谢你的帮助!