我想通过CSS HTML将下划线更改为一个点,一个单独的点。

huangapple go评论84阅读模式
英文:

I want to change the Underline for a Dot, a single dot using CSS HTML

问题

我想要将下划线改成一个点,一个单独的点,也就是说,当光标悬停在“Home”上时,会出现一个点,对于每个选项,如“Movies”、“Music”等也是如此。请使用 #CSS #HTML。

英文:

enter image description here

I want to change the Underline for a Dot, a single Dot, that is, when the cursor is over "Home" a Dot appears and so for each Option such as "Movies" "Music" .. etc Please #CSS #HTML

答案1

得分: 1

如果我理解问题正确,这是你的起始点:

<a href="#">电影</a>
英文:

If I understand the question correctly, this is your starting point:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->

a {
  display: inline-block;
  position: relative;
  padding-bottom: 8px;
  text-decoration: none;
  color: inherit;
}

a:hover:after {
  transition-delay: .2s;
}

a:hover:before {
  transition-delay: 0s;
}

a:hover:before {
  transform: scaleX(0);
}

a:hover:after {
  transform: scale(1);
}

a:before,
a:after {
  content: &#39;&#39;;
  position: absolute;
  background-color: currentColor;
}

a:before {
  inset: auto 0 3px;
  height: 1px;
  transition: transform .2s .2s;
}

a:after {
  width: 6px;
  height: 6px;
  inset: auto calc(50% - 3px) 0;
  transition: transform .2s;
  transform: scale(0);
  border-radius: 50%;
}

<!-- language: lang-html -->

&lt;a href=&quot;#&quot;&gt;Movies&lt;/a&gt;

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年6月26日 03:29:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76552099.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定