设置超链接不可点击的css样式:
a{ pointer-events:none; color:#afafaf; cursor:default }
上述样式详解:
pointer-events:none;设置链接失效,pointer-events属性指定在什么情况下 (如果有) 某个特定的图形元素可以成为鼠标事件的target。
color:#afafaf;样式设置链接颜色为灰色。
cursor:default设置鼠标在链接上的样式。
示例
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>设置超链接不可点击实例</title> <style> a{ pointer-events:none; color:#afafaf; cursor:default } </style> </head> <body> <a href="https://www.0133.cn/">HTML中文网</a> </body> </html>
效果图:
以上就是css如何设置超链接不可点击?的详细内容,更多请关注0133技术站其它相关文章!