我正在尝试创建一个简单的导航栏,但我希望“navbar”中的链接为灰色,同时保持页面上的其他链接默认。我似乎无法让它正常工作。有人可以帮忙吗?
<!-- Start Navbar -->
<strong>
<body "link="gray" vlink="gray" alink="gray">
<style>
table,th,td
{
border:5px solid black;
border-collapse:collapse;
}
</style>
<table class="center" background="http://cdnleicester.tab.co.uk/wp-content/blogs.dir/41/files/2013/10/black.png">
<tr><td><a href="stonehardlinks.html">Home</a></td>
<td><a href="linklist1.html">Link List 1</a></td>
<td>Link List 2</td>
<td>Link List 3</td>
<td>YouTube Channels</td>
</tr>
</table>
</body>
</strong>
<!-- End Navbar -->
<body link="#0000FF" vlink="#800080" alink="#FF0000" leftmargin="10" topmargin="10" scroll="yes" background="http://thewallmachine.com/files/1345578090.jpg">
<a href="examplelink">examplelink</a>
</body>
答案 0 :(得分:0)
<强> CSS 强>
.center a { color:#<whatcoloryouwant>}
<强> HTML 强>
<body>
<style type="text/css">
table,th,td
{
border:5px solid black;
border-collapse:collapse;
/*replace <strong> wrapping body */
font-weight:700; /*bold*/
}
/*class for all navbar links*/
.center a {
color:#<whatcoloryouwant>
}
/*general links*/
a {
color:#<somecoloryouwant>
}
</style>
<table class="center" background="http://cdnleicester.tab.co.uk/wp-content/blogs.dir/41/files/2013/10/black.png">
<tr><td><a href="stonehardlinks.html">Home</a></td>
<td><a href="linklist1.html">Link List 1</a></td>
<td>Link List 2</td>
<td>Link List 3</td>
<td>YouTube Channels</td>
</tr>
</table>
</body>
答案 1 :(得分:0)
这应该有效
table.center a{
color:gray !important;
}
所有其他人:
a{
color:somecolor;
}
BTW,您的HTML无效
答案 2 :(得分:0)
第一个答案是对的,但为什么你用强力标签包裹身体?
答案 3 :(得分:0)
<html>
<head>
<tile>your page title goes here</tile>
<meta></meta>
</head>
<body>
your main content for your pages starts here
<table>
<tr><td></td></tr>
</table>
</body>
</html>
Meta是另一个首先清楚你的基础知识的故事