我无法为我的 href 添加多功能。
这是我的代码:
HTML:
<html>
<head>
<link rel="stylesheet" type="text/css" href="css-style.css">
<title></title>
</head>
<body>
<h1>Hello HTML!</h1>
<p>I am Hristiqn. I am from <a class="magic" href="https://en.wikipedia.org/wiki/Neverland">Neverland</a></p>
</body>
</html>
CSS:
a.magic:visited {font-size: 300px;
background: -webkit-linear-gradient(gold,green);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;}
a.magic:active {font-size: 300px;
background: -webkit-linear-gradient(red,green);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;}
a.magic:hover { font-size: 60px;
background: -webkit-linear-gradient(white, green);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;}
现在我正在尝试通过将所需的样式属性设置为一个名为 magic 的类来做到这一点,但似乎只有 :hover 有效。 我尝试按名称设置属性,但效果是一样的 - 只有悬停有效。
所以我希望链接按钮在我将鼠标悬停在它上面时执行不同的操作,只要它处于事件状态等等,但似乎只有我的 :hover 语句有效,我不知道为什么。
谢谢。
最佳答案
我注意到你的 </a>
被错误地关闭。尝试解决这个问题。
关于html - 我在 CSS 中只有一个类语句有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42577642/