Home > Article > Web Front-end > How to set hyperlinks to be non-clickable in css
How to set the hyperlink to be non-clickable in css: first use the "cursor:pointer;" attribute to turn the mouse into an arrow; then use the "pointer-events:none;" attribute to make the hyperlink invalid and non-clickable.
The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer.
Use css settings to make hyperlinks unclickable or invalid
##cursor :pointer; pointer-events: none;
The first line is to make the mouse turn into an arrow instead of a small hand shape
The second line is to invalidate the hyperlink code
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> </head> <body> <a class="weather" href="http://www.baidu.com" >测试</a> <iframe class="weather" allowtransparency="true" frameborder="0" width="385" height="96" scrolling="no" src="//tianqi.2345.com/plugin/widget/index.htm?s=2&z=2&t=0&v=0&d=3&bd=0&k=&f=<f=009944&htf=cc0000&q=1&e=0&a=0&c=60813&w=385&h=96&align=center"></iframe> </body> <style type="text/css"> .weather{ color:gray; cursor:pointer; pointer-events: none; } </style></html>
CSS video tutorial column!
The above is the detailed content of How to set hyperlinks to be non-clickable in css. For more information, please follow other related articles on the PHP Chinese website!