I was just on w3Schools looking at target and found that it is no longer supported by any of the major browsers. A brief google search did not reveal the reason for this? Should I avoid the use of target all together?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
It is supported by most major browsers. It's just not part of the strict HTML specifications from the W3C. However, browsers implement it even when using a strict doctype. This fact is sometimes used to emulate its behaviour with JavaScript while keeping HTML that still validates:
And:
In transitional doctypes, no workaround is required.
It was briefly taken out of html5, but they put it back in. Feel free to continue using it as all browsers should support it.
See http://www.w3schools.com/tags/tag_a.asp ... You will see target attribute is still supported there.
I went to w3School and i found that The target attribute is no longer deprecated in HTML5.
target
attribute is supported by all browsers.It has been removed from HTML4 Strict and XHTML 1 Strict, because these don't allow frames, and because forcing new windows on users isn't always good idea (e.g. Back button in new window will be disabled, which confuses some users).
target
has been added back in HTML5. You can use it, but don't abuse it.It's OK if you want to open help page in new window on page that has a long form (you don't want users to lose content of the form), but it's not OK to force every link in new window in hope it'll make your page harder to leave.
And please don't try cheat validator by using scripts to open new windows. It gives same negative effect to users (or even worse if it breaks when JS is disabled), but is harder to detect and control than
target
.BTW: Please don't treat W3Schools as authoritative. They're not affiliated with W3C in any way, and their tutorials often contain mistakes.
The <a> tags target attribute is still supported by all major browsers (@w3schools).
It's still allowed in regular HTML and transitional xHTML, but not in strict xHTML anymore. The idea behind this was that users like to choose for themselves how to open a link, and not have it forced upon them by the browser.