HTML超链接和CSS设置样式
1、首先,我来新建一个超链接,实现的代码如下:<html> <head> <title>超链接</title> <style> </style> </head> <body> <a href="http://www.baidu.com">我是一个超链接</a> </body></html>可以看到不设置样式的情况下,默认显示带下划线的蓝色字体为超链接的样式,具体效果如下图所示。

3、我们想要看看超链接文字未被选中时候的颜色为红色并且没有下划线,具体代码如下:<html> <head> <title>超链接</title> <style> a:link{ text-decoration:none; color:red; } </style> </head> <body> <a href="http://www.baidu.com">我是一个超链接</a> </body></html>可以看到如下图的信息,超链接变成了红色,并且没有了下划线。

5、这里我来设计当点击了簦蹿另迹超链接的之后,超链接变成绿色,而且没有下划线,具体实现代码如下:<html> <head> <title>超链接&造婷用痃lt;/title> <style> a:link{ text-decoration:none; color:red; } a:hover { text-decoration:underline; color:blue; } a:visited{ color:green; text-decoration:none; } </style> </head> <body> <a href="http://www.baidu.com">我是一个超链接</a> </body></html>可以看到,访问之后的超链接变成了无下划线的绿色字体了。
