1、純css實(shí)現(xiàn)html中a標(biāo)簽的禁用:
代碼如下:
<html>
<head>
<title>如何禁用a標(biāo)簽</title>
<metacontent="text/html;charset=GB2312"http-equiv="Content-Type">
<styletype="text/css">
body{
font:12px/1.5\5B8B\4F53,Georgia,TimesNewRoman,serif,arial;
}
a{
text-decoration:none;
outline:0none;
}
.disableCss{
pointer-events:none;
color:#afafaf;
cursor:default
}
</style>
</head>
<body>
<aclass="disableCss">點(diǎn)擊</a>
</body>
</html>
上面使用了純Jquery實(shí)現(xiàn)了禁用html中a標(biāo)簽的功能。