Dreamweaver bulk erase "dotted box" on a Web page connection

Source: Internet
Author: User
Tags html page new set dreamweaver

As you all know, onfocus= "This.blur ()" This code can eliminate the link when the dotted box, but have you ever thought that if you have several or even hundreds of links on the page, and you want to remove the above nasty dotted box, you also go to CTRL + C, CTRL + V, Oh, my God! This is definitely a nightmare for a normal person.

You might say, "Find/Replace" in DW or other text editors can be solved, yes! Admittedly, this is a good idea, but as a good web developer, with as few code as possible to achieve the same functionality is the goal we should pursue, the following we use HTC to solve this problem.

As for HTC, the full name is HTML components, a new set of instructions that Microsoft began to offer after IE5.0, which encapsulates code for a particular function in a single component, enabling reuse of code. As a component, HTC contains the attributes, methods, events, and so on a variety of knowledge, here is not one of the details, you can refer to the Microsoft MSDN homepage.

Back to the beginning, Onfocus=this.blur () Obviously, onfocus is an event, This.blur () is an object triggered by events, and since this is clear, the code knows what to write.

<public:attach event= "onfocus" onevent= "example ()"/>

<script language= "Javascript" >

function Example () {

This.blur ();

}

</script>

Save the above code as an. htc file with an extension, and then write an ordinary HTML page

<style>

A {Behavior:url (the path address of the HTC File)}

</style>

<body>

<a href= "#" > Links 1</a>

<a href= "#" > Links 2</a>

<a href= "#" > Links 3</a>

Click the link to try, there is no dotted box it

</body>

OK, save, preview, how? The effect came out, and then look at the code, indeed a lot of streamlining, and in the link more and more manifest more obvious. Finally, I would like to say that this is only the tip of the HTC application of the iceberg, more features you need to know, I believe that a bit of JS and CSS based on you will be able to learn.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.