gpt4 book ai didi

Html:在新窗口中打开页面。 target ="_blanck"- 这是错字吗?

转载 作者:太空宇宙 更新时间:2023-11-04 15:30:15 25 4
gpt4 key购买 nike

我找到了(带有字母c)

target="_blanck"

而不是预期的

target="_blank"

在别人写的项目中。它可以工作并在新窗口中打开链接。这是错字还是我遗漏了什么?

最佳答案

target 属性指的是链接内容将在您的浏览器中加载的位置。浏览器会将页面内容放入具有该名称的窗口/框架内,只要它不是特殊值之一 _blank_self_top _parent。查看Frame target references w3 规范中的部分。

Except for the reserved names listed below, frame target names (%FrameTarget; in the DTD) must begin with an alphabetic character (a-zA-Z). User agents should ignore all other target names.

The following target names are reserved and have special meanings.

_blank The user agent should load the designated document in a new, unnamed window.
_self The user agent should load the document in the same frame as the element that refers to this target.
_parent The user agent should load the document into the immediate FRAMESET parent of the current frame. This value is equivalent to _self if the current frame has no parent.
_top The user agent should load the document into the full, original window (thus canceling all other frames). This value is equivalent to _self if the current frame has no parent.

所以,如果链接总是打开一个新窗口,它应该是_blank。如果有多个链接具有相同的 target=_blanck,如果它们应该始终替换同一窗口的内容,则可能是故意的。

参见 this fiddle :

<a href="http://www.stackoverflow.com" target="_blank">This opens SO always in a new window</a>
<a href="http://www.google.com" target="_blanck">This opens google in a given window</a>
<a href="http://www.stackoverflow.com" target="_blanck">This opens SO in the same given window</a>

关于Html:在新窗口中打开页面。 target ="_blanck"- 这是错字吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14891211/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com