概览

在默认样式外指定一个用于 alink 超链接的私有样式,在 a{} 的后面追加要设置的类名,即 a.className:link{}

在页面应用时将 alink 超链接加上类名就可以应用生效:a class='className'

样式

a.className:link {
  text-decoration: none;
  color: #ff0018;
}

a.className:visited {
  text-decoration: none;
  color: #7f7f7f
}

a.className:hover {
  text-decoration: none;
  color: #ffbb8d;
}

a.className:active {
  text-decoration: none;
  color: #ffbb8d;
}

应用

<a class='className' href='//hexingxing.cn' target='_blank'>link</a>

更多

div.className
span.className
hr.className
p.className

何星星原创文章仅用于个人学习,当前页面暂不支持复制操作,了解详情或文章转载请 点此 继续!
分类: 前端开发

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用*标注