【发布时间】:2020-08-09 00:49:59
【问题描述】:
当我使用“Lato Regular 900”字体系列时,当我将文本悬停时,它会破坏“text-decoration:underline”属性。是否有任何解决方案可以从底部移动下划线属性。这样它就不会破坏文本下划线。 如图所示enter image description here
我想要这张照片 enter image description here
而我的html代码是`
<html>
<head>
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@900&display=swap" rel="stylesheet">
<style>
a:link {
text-decoration: none;
font-family: 'Lato', sans-serif;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<a href='' onmouseover>UI/UX DESIGNING</a>
</body>
</html>
`
【问题讨论】:
-
改用底部边框
-
您的代码在这里运行良好,但如果它不能在您的最后运行,那么您可以按照上面的建议在悬停时使用border-bottom。
标签: html css css-transitions