由于某种原因链接无法更改颜色?
问题描述:
嘿,我不能因为某些原因改变我的(a)元素的悬停颜色。由于某种原因,它停留在浏览器的默认设置上?谁能告诉我为什么?由于某种原因链接无法更改颜色?
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/*
=================================
Custom Styles
=================================
*/
body {
color: #888;
font: 300 16px/22px "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
/*
=================================
Grid
=================================
*/
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.container,
.grid {
margin: 0 auto;
}
.container {
padding-left: 30px;
padding-right: 30px;
}
.col-1-3 {
width: 33.33%;
}
.col-2-3 {
width: 66.66%;
}
.col-1-3 {
display: inline-block;
vertical-align: top;
}
.grid,
.col-1-3,
.col-2-3 {
padding-left: 15px;
padding-right: 15px;
}
.center-me {
text-align: center;
}
/*
======================
Clearfix
======================
*/
.group:before .group:after {
content: "";
display: table;
}
.group:after {
clear: both;
}
.group {
clear: both;
*zoom: 1;
}
/*
==============================
Primary Header
==============================
*/
.logo {
text-align: center;
}
/*
===============================
Typography
===============================
*/
h1,
h3,
h4,
h5,
p {
margin-bottom: 22px;
}
h1 {
color: #a67c00;
font-size: 24px;
line-height: 44px;
}
h2 {
font-size: 21px;
line-height: 44px;
}
h3 {
font-size: 21px;
}
h4 {
font-size: 18px;
}
h5 {
/* \t color: #a9b2b9;*/
font-size: 14px;
/* font-weight: 400;*/
strong {
font-weight: 400;
}
cite,
em {
font-style: italic;
}
/*
================================
Buttons
===============================
*/
.btn {
border-radius: 5px;
display: inline-block;
margin: 0;
}
.btn-alt {
border: 1px solid #dfe2e5;
padding: 10px 30px;
}
.primary-nav {
font-size: 14px;
font-weight: 400;
letter-spacing: .5px;
text-transform: uppercase;
}
/*
==================
Links
==================
*/
a:hover {
color: #a67c00;
}
a {
color: #000000;
}
<title>Rysh</title>
<body>
<!--header-->
<header class="container center-me">
<h1 class="logo">Rysh</h1>
<nav class="primary-nav">
<a href="shop.html">Shop</a>
<a href="about.html">About</a>
</nav>
</header>
</body>
您可以在最底层看到我的(一)在CSS元素,上面只是一个CSS重置
答
你的CSS有语法错误。您的H5规则未正确关闭,导致其后的所有内容都出现问题。
h5 {
/* color: #a9b2b9;*/
font-size: 14px;
/* font-weight: 400;*/
strong {
font-weight: 400;
}
应该是:
h5 {
/* color: #a9b2b9;*/
font-size: 14px;
}
strong {
/* font-weight: 400;*/
font-weight: 400;
}
答
你在你的CSS代码已经有语法错误的位置:
h5 {
font-size: 14px;
strong {
font-weight: 400;
}
cite,
em {
font-style: italic;
}
缺什么? ;-)
关闭 'H5' 与 “}”
h5 {
font-size: 14px;
strong {
font-weight: 400;
}
cite,
em {
font-style: italic;
}
}
*祝你好运!
我upvoted否定downvote。我真的好奇为什么有一个downvote,这是一个非常有效的答案。 –
谢谢@MarkoGrešak,我想知道同样的哈哈 – hellojebus
这是我刚刚发现后,把它扔在小提琴中的答案。添加一个这样的链接:https://jigsaw.w3.org/css-validator/ – sheriffderek