How to remove a tags and buttons and add dotted lines / shadows to background pictures
This article is about how to remove a tags and buttons and add dotted lines / shadows to background images. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
When the user registers, they will click on an a tag to change the CAPTCHA. When clicked, there is a shadow on the a tab. For those who like beauty, it is intolerable!
What is the reason for this? It turned out that it was the href attribute of the a tag that caused the trouble.
1. Only a tag
There are two solutions to what I know.
One: prescribe the right medicine to the case. Since it was caused by href. Then remove the href attribute.
When we use href=_javascript:RefreshCode (); just update the CAPTCHA. There is no jump to the page.
The code is as follows:
can't see clearly? Change the picture.
So you can remove the href, tag a with the onclick event, and call the update CAPTCHA function.
The code is as follows:
can't see clearly? Change the picture.
Second: take a step back. seek common ground while reserving differences. Since you want to use the href property. Okay. Then I'll add another event for you: onfocus.
As long as you modify it, you can perfect it and add an onfocus= "this.blur ()" to the a tag.
That's for sure. If you want the a label to be ununderlined. Style= "text-decoration: none"
The code is as follows:
can't see clearly? Change the picture.
The effect after modification is completed
In browsers such as FF, it is relatively easy to define the style outline:none; for tag a directly, that is:
The code is as follows:
A {outline:none;}
Of course, this is just the removal of a single. If the page has multiple a tags, shouldn't you add onfocus events one by one?
Of course not. We can do it when the page is loaded. Get all the a tags on the page by: window.document.links.length (where window can be omitted). Then iterate over the registration event.
The code is as follows:
_ window.onload=function () {
For (var item0; I