Home > Web Front-end > HTML Tutorial > 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
Release: 2016-05-16 16:37:44
Original
1634 people have browsed it

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标签的功能。
Related labels:
source:php.cn
Previous article:Detailed explanation of single-select and multiple-select usage of select tag in HTML_HTML/Xhtml_Web page production Next article:The size of the textarea tag is immutable and cannot be dragged by mouse drag_HTML/Xhtml_Web page production
Statement of this Website
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
Latest Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template