我对编程很陌生,我在我的 CSS 中导入了一个代码片段,以获得链接上的悬停效果。当我通过 W3C CSS Validator 推送代码时,我收到一个来自此导入代码的错误。
我不明白我能做些什么来消除错误,因为悬停效果完美。
谁能帮我?将不胜感激!
错误:
值错误:背景 100% 不是颜色停止值)
代码:
:root {
--mainColor: #ffc7c7;
}
.details-schedule {
align-items: center;
display: flex;
font-family: 'Libre Franklin', sans-serif;
font-size: 16px;
justify-content: center;
}
.details-schedule a {
background:
linear-gradient(
to bottom, var(--mainColor) 0%,
var(--mainColor) 100%
);
background-position: 0 100%;
background-repeat: repeat-x;
background-size: 4px 4px;
color: #000;
text-decoration: none;
transition: background-size .6s;
}
.details-schedule a:hover {
background-size: 4px 50px;
}