同一HTML页面上的不同颜色链接 [英] Different Color Links on the Same HTML Page

查看:401
本文介绍了同一HTML页面上的不同颜色链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正尝试在同一页面上使用不同的颜色链接。我想要一些链接是蓝色的,一些链接是黑色的。

Hi I am trying to have different color links on the same page. I want some links to be blue and some links to be black. I am new to html and CSS so thank you in advance!

-Spencer

推荐答案

CSS

CSS:

A.class1 {color:red;}
A.class1:link  {text-decoration: none; color: red;}
A.class1:visited {text-decoration: none; color: red;}
A.class1:hover {text-decoration: underline; color: red;}
A.class1:active {text-decoration: none; color: red;}


A.class2 {color:blue;}
A.class2:link {text-decoration: none; color: blue;}
A.class2:visited {text-decoration: none; color: blue;}
A.class2:hover {text-decoration: underline; color: blue;}
A.class2:active {text-decoration: none; color: blue;}

HTML

HTML:

<a href="http://www.google.com" class="class1">Google</a>
<a href="http://stackoverflow.com" class="class2">Stackoverflow</a>

演示
http://cssdesk.com/qukaq

这篇关于同一HTML页面上的不同颜色链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆