【发布时间】:2020-11-16 20:01:10
【问题描述】:
我在 CSS 中的 a:link 和 a:visited 代码不起作用。我不知道为什么,这有点奇怪
此外,它实际上与我想要的相反。访问之前,链接是紫色的,之后是一样的。
body {
background-color: lightgoldenrodyellow;
font-family: century gothic;
}
header {
display: flex;
justify-content: space-between;
width: 100%;
white-space: nowrap;
}
h1 {
display: inline-block;
font-size: 30px;
text-decoration: underline;
}
nav {
display: inline-block;
}
ul {
color: black;
}
li {
display: inline;
font-size: 30px;
margin-left: 10px;
margin-right: 10px;
}
a:link {
color: black;
}
a:visited {
color: blueviolet;
}
footer {
text-align: center;
margin: 10px;
}
#image1,
#image2 {
border-radius: 6px;
display: block;
margin: auto;
margin-bottom: 80px;
width: 70%;
}
p {
text-align-last: center;
font-family: helvetica, lucida grande, sans-serif;
font-size: 30px;
}
<header>
<nav>
<ul>
<li><a href="#">Home</a>
</li>
<li><a href="#">About</a>
</li>
<li><a href="#">Blog</a>
</li>
<li><a href="#">Event</a>
</li>
<li><a href="#">Gallery</a>
</li>
<li><a href="#">Contact</a>
</li>
</ul>
</nav>
</header>
<p>Your Home Show Your Vision</p>
<img src="p.d.jpg" alt="Your Perspective" id="image1" />
<img src="e7179db2d394aab60672c37700e15612.jpg" alt="Your Perspective" id="image2" />
<footer>Copyright © 2017</footer>
【问题讨论】:
-
所有引用当前文档的链接都可能被视为已访问,因为它们引用了当前文档,并且您已访问过该文档。
-
@Naila 请不要在 cmets 部分进行投票和/或接受活动。 OP 会收到所有答案的通知,不需要提醒,它会作为噪音传给我们其他人。