我是靠谱客的博主 甜美牛排,这篇文章主要介绍html中如何设置超链接的样式,现在分享给大家,希望可以做个参考。

设置超链接的样式示例:

a:link 超链接被点前状态

a:visited 超链接点击后状态

a:hover 悬停在超链接时

a:active 点击超链接时

在定义这些状态时,有一个顺序l v h a。

(推荐教程:html教程)

代码区:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> a:link { color:#000; text-decoration:none;} a:visited { color:#000; text-decoration:none;} a:hover { color:#F00; text-decoration:underline;} a:active { color:#F90; text-decoration:underline;} </style> <link href="Untitled-1.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="http://www.baidu.com/">百度一下</a> </body> </html>
登录后复制

运行显示:鼠标箭头未放到“百度一下”,其显示黑色——放上时,其显示红色——点击“百度一下”链接时,其显示橙色——点击后,其显示黑色。

相关视频教程推荐:html视频教程

以上就是html中如何设置超链接的样式的详细内容,更多请关注靠谱客其它相关文章!

最后

以上就是甜美牛排最近收集整理的关于html中如何设置超链接的样式的全部内容,更多相关html中如何设置超链接内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(82)

评论列表共有 0 条评论

立即
投稿
返回
顶部