CSS不修改链接属性 [英] CSS not modifying link properties
问题描述
无论我尝试做什么,我不能修改我的链接的颜色(想创建一个颜色翻转效果)。他们总是保持相同的默认蓝色与下划线的效果。
Whatever I try to do, I can't modify the color of my links ( want to create a color rollover effect). They always stay the same default blue color with the underline effects. I know its something very minor that I did wrong, but can anyone tell me?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<style type="text/css">
body,
html {
margin:0;
padding:0;
color:#101010;
font-family: helvetica;
}
p {
margin:10px 0 0 20px;
font-size: 13px;
line-height: 1.3em;
padding-bottom: 10px;
}
#wrapper {
width:960px;
margin:0 auto;
padding: 0px;
background:#fff;
}
#header {
padding:5px 10px;
background:#fff;
height:518px;
}
#nav {
padding:5px 10px;
background:#fff;
width: 960px;
height: 35px;
position: absolute;
top: 370px;
font-size: 18px;
color: #000;
}
#nav ul {
margin:0;
padding:0;
list-style:none;
position: absolute;
bottom: 5px;
}
#nav li {
display:inline;
margin:0;
padding:0;
width:160px;
float:left;
#nav li:hover {
background-color: #faffd8;
border-color: #004f7b;
}
#nav a {
color: #000;
text-decoration: none;
}
#nav a:link {
color: #333333;
text-indent: -9999px;
text-decoration: none;
}
#nav a:hover {
color: #000000;
text-decoration: none;
}
#nav a:visited{
color: #999999;
text-decoration: none;
}
#nav a:active {
color: #000000;
text-decoration: none;
}
#topcontent p
{
color: #444444;
}
}
#leftcontent {
float:left;
width:480px;
height: 1%;
background:#fff;
}
h2 {
margin:10px 0 0 20px;
color: #24389b;
font-size: 19px;
padding-bottom: 8px;
}
#rightcontent {
float:right;
width:480px;
background:#fff;
height: 1%;
}
#footer {
clear:both;
padding:5px 10px;
background:#fff;
}
#footer p {
margin:0;
}
* html #footer {
height:1px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="header"><img src="pold.png" alt="Pold Logo" /></div>
<div id="nav">
<ul>
<li><a href="Research">Research</a></li>
<li><a href="Research">Publications</a></li>
<li><a href="Research">Software</a></li>
<li><a href="Research">People</a></li>
<li><a href="Research">Volunteer</a></li>
<li><a href="Research">Resources</a></li>
</ul>
</div>
<div id="topcontent">
<p>The interests of our lab are generally centered around....</p>
</div>
<div id="leftcontent">
<h2>Funded Projects</h2>
<p><a href="url">The Cognitive Atlas</a><br />(funded by NIMH )<br />The Cognitive Atlas project aims to develop an ontology for cognitive processes through social collaborative knowledge building.</p>
</div>
<div id="rightcontent">
<h2>Center Grants</h2>
<p><a href="url">Consortium for Neuropsychiatric Phenomics</a><br />(funded by NIH)<br />This Roadmap Interdisciplinary Research Consortium is leveraging the new discipline of phonemics to understand neuropsychiatric disorders at multiple levels, from genes to neural systems to </p>
</div>
<div id="footer">
</div>
</div>
</body>
</html>
新编辑09/27:
New Edit 09/27:
全部。我为发布两次道歉 - 我是全新的在这里,并没有想到继续这个线程。正如我的帖子所示(见Sparky672的链接),我有我的列和我的导航看起来我的想法有问题。请参阅此链接,了解演示 http://rich2233.host22.com/pold.html 。我想你可以从你的浏览器抓取代码。感谢您的帮助
All. I apologize for posting twice -- I'm brand new here and didn't think to continue on this thread. As indicated on my post (see Sparky672's link), I'm having problems with my columns and my navigation looking how I want it. Please see this link for a demo http://rich2233.host22.com/pold.html .. I guess you can grab the code from your browser. Thanks for your help
推荐答案
**#nav li {
display:inline;
margin:0;
padding:0;
width:160px;
float:left;**
#nav li:hover {
background-color: #faffd8;
border-color: #004f7b;
}
#nav a {
color: #000;
text-decoration: none;
}
#nav a:link {
color: #333333;
text-indent: -9999px;
text-decoration: none;
}
#nav a:hover {
color: #000000;
text-decoration: none;
}
#nav a:visited{
color: #999999;
text-decoration: none;
}
#nav a:active {
color: #000000;
text-decoration: none;
}
**#topcontent p
{
color: #444444;
}
}**
**检查加星标的CSS样式,第一个CSS样式没有关闭,最后一个CSS样式也关闭。
** check starred CSS Styles there no closing for first CSS style also extra closing for last one
这篇关于CSS不修改链接属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!