Home  >  Article  >  Web Front-end  >  Use pure css to disable the a tag in html without JavaScript_HTML/Xhtml_web page production

Use pure css to disable the a tag in html without JavaScript_HTML/Xhtml_web page production

WBOY
WBOYOriginal
2016-05-16 16:37:441596browse

In fact, this problem has already arisen when I first learned about the select tag in HTML. To this day, I still haven’t found a way to use pure CSS to disable the a tag. I have asked my colleagues, classmates, and teachers, and they all resorted to the same method. If you don’t have JavaScript, is it really necessary to use JavaScript?

1. Pure CSS to disable the a tag in HTML:

Copy the code
The code is as follows:



How to disable a tag




Baidu
       
Click



Although the above uses pure CSS to disable the a tag, because Opera and IE browsers do not support the pointer-events style, the above code cannot disable the a tag in these two types of browsers.

2. Use Jquery and css to disable the a tag in html:

Copy code
code As follows:



02 - Use Jquery and css to disable the a tag in html






百度
       
点击



上面使用了纯Jquery实现了禁用html中a标签的功能。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Detailed explanation of single-select and multiple-select usage of select tag in HTML_HTML/Xhtml_Web page productionNext article:Detailed explanation of single-select and multiple-select usage of select tag in HTML_HTML/Xhtml_Web page production

Related articles

See more