带有id或类的stylink链接不起作用 [英] stylink link with id or with class does not work
本文介绍了带有id或类的stylink链接不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是工作
this is work
<html>
<head>
<style = "text/css">
a:link {text-decoration:none;}
a: visited {font-color: white;}
a: hover {text-decoration: underline;}
a: active {text-decoration: none;}
</style>
</head>
<body>
<a class ="c" href ="google">the link </a>
</body>
</html>
但是,当我给予课程或身份证时,它不起作用我不知道为什么这里是下面的代码,当我给上课或身份
but when i do give class or id it does not work i dont know why here is the code below when i am giving class or id
<html>
<head>
<style = "text/css">
# c a:link {text-decoration:none;}
# c a: visited {font-color: white;}
#c a: hover {text-decoration: underline;}
#c a: active {text-decoration: none;}
</style>
</head>
<body>
<a id ="c" href ="google">the link </a>
</body>
</html>
i也尝试使用类同名c并应用此方法
i did also try to use class gave the same name "c" and apply this methode
.c a:link {text-decoration:none;}
.c a: visited {font-color: white;}
.c a: hover {text-decoration: underline;}
.c a: active {text-decoration: none;}
i也尝试使用ac:visited {}
但到目前为止没有任何工作
i also try to use a.c : visited {}
but so far nothing has work
推荐答案
删除a:
和已访问
之间的空格,hover
和有效
。另外,将font-color
更改为color
并更改< style =text:css >
进入< style type =text / css>
,并将href =google
更改为href =http: //www.google.com
Hi,
Remove the spaces betweena:
andvisited
,hover
andactive
. Also, changefont-color
intocolor
and change<style = "text:css">
into< style type="text/css">
, and changehref="google"
intohref="http://www.google.com"
<html>
<head>
<style type="text/css">
a:link {text-decoration:none;}
a:visited {color: white;}
a:hover {text-decoration: underline;}
a:active {text-decoration: none;}
</style>
</head>
<body>
<a class ="c" href ="http://www.google.com">the link </a>
</body>
</html>
希望这会有所帮助。
Hope this helps.
我通过这样做找到答案并且工作正常
i found the answer by doing this and it work fine
<span id="c"><a href="google">link </a></span>
这篇关于带有id或类的stylink链接不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文