html - 始终具有虚线样式的链接

标签 html css

我正在尝试创建一个页面,其中包含带 anchor 的链接,并且所有链接都是指向同一页面但位于不同位置的 anchor 。链接应始终具有“虚线”样式,并且永远不要加下划线。这不能正常工作:

   a:hover, a:link, a:active .link-anchor {
     border-bottom: 1px dashed #aabbccdd ;
     text-decoration: dashed !important;
  }

最佳答案

您定义了无效的颜色代码,如下所示:

border-bottom: 1px dashed #aabbccdd;
                          // ^^^ there should be 3 or 6 characters

应该是:

border-bottom: 1px dashed #aabbcc;

有关 css 颜色的更多详细信息,请访问 Here .

a.link-anchor:hover, a.link-anchor:link, a.link-anchor:active {
  border-bottom: 1px dashed #aabbcc;
  text-decoration: none;
}
<p>Lorem ipsum dolor <a href="#" class="link-anchor">Dashed Link</a> sit amet <a href="#">Normal Link</a> Lorem ipsum dolor <a href="#" class="link-anchor">Dashed Link</a> sit amet <a href="#" class="link-anchor">Dashed Link</a> Lorem ipsum dolor</p>

关于html - 始终具有虚线样式的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38736919/

相关文章:

html - 单元格表格中的翻转图像覆盖先前的单元格图像 - 表格中的重复图像

javascript - 如何触发浏览器密码保存

html - ng-repeat 创建一个多嵌套表

css - 如何为我的字体制作一个 cdn?

css - Internet Explorer 字体 ssl

html - Bootstrap slider 不起作用

jquery - 调整窗口大小时保持 "position: fixed"div 的水平位置

python - 从数据库传递 URL 参数

html - 当我不想创建另一个时如何重用我的 <div>

php - 使用 X-Send 模块提供 css、javascript 和图像文件