


Various ways to remove link dotted boxes with CSS and JS_html/css_WEB-ITnose
When we click on a link, a dotted box will be displayed around the link. So how to remove this dotted box? In fact, there are many methods, just use CSS, but using javaScript seems to be a good method as well.
1. CSS method to remove the link dotted frame:
In IE, use the html attribute: hideFoucs, and add the hidefocus="true" attribute to the HTML tag, but this attribute is IE If it is private, Firefox will not recognize it. Front-end framework example
. Code
Processed with CSS in IE:
. Code
- a{noOutline:expression(this.onFocus=this.blur());}/* "onFocus" Note the case*/
Firefox’s processing method is more in line with the standard. You only need to set a:focus{outline:none} in the CSS style code. Next, let’s take a look at the unified processing method in MSIE and FF:
. Code
- a{
- outline:none ; /*FF*/
- noOutline:expression(this.onFocus=this.blur());/*IE*/
- }
Considering performance optimization, you can refer to the following code:
. Code
- a{outline:none;}
- a:active{noOutline:expression(this.onFocus=this.blur());}
- :focus{outline:0;}
2. Use js to solve the link virtual box method: front-end framework example
. Code
- $("a").bind("focus", function(){
- if(this.blur){
- this.blur();
- }
- });

HTML is not only the skeleton of web pages, but is more widely used in many fields: 1. In web page development, HTML defines the page structure and combines CSS and JavaScript to achieve rich interfaces. 2. In mobile application development, HTML5 supports offline storage and geolocation functions. 3. In emails and newsletters, HTML improves the format and multimedia effects of emails. 4. In game development, HTML5's Canvas API is used to create 2D and 3D games.

TheroottaginanHTMLdocumentis.Itservesasthetop-levelelementthatencapsulatesallothercontent,ensuringproperdocumentstructureandbrowserparsing.

The article explains that HTML tags are syntax markers used to define elements, while elements are complete units including tags and content. They work together to structure webpages.Character count: 159

The article discusses the roles of <head> and <body> tags in HTML, their impact on user experience, and SEO implications. Proper structuring enhances website functionality and search engine optimization.

The article discusses the differences between HTML tags , , , and , focusing on their semantic vs. presentational uses and their impact on SEO and accessibility.

Article discusses specifying character encoding in HTML, focusing on UTF-8. Main issue: ensuring correct display of text, preventing garbled characters, and enhancing SEO and accessibility.

The article discusses various HTML formatting tags used for structuring and styling web content, emphasizing their effects on text appearance and the importance of semantic tags for accessibility and SEO.

The article discusses the differences between HTML's 'id' and 'class' attributes, focusing on their uniqueness, purpose, CSS syntax, and specificity. It explains how their use impacts webpage styling and functionality, and provides best practices for


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6
Visual web development tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

WebStorm Mac version
Useful JavaScript development tools
