我刚刚使用 w3c 验证程序服务验证了我的实际 XHTML Strict 1.0 文档。它说,
<ul id="socialnetwork">
<li><a href="http://www.twitter.com" target="_blank"></a></li>
<li><a href="http://www.flickr.com" target="_blank"></a></li>
<li><a href="http://www.xing.com" target="_blank"></a></li>
<li><a href="http://www.rss.com" target="_blank"></a></li>
</ul>
target="_blank"无效..但我需要目标为空,以便在浏览器中打开一个新选项卡,这样用户就不会离开主页。
我能做什么?为什么这无效?
最佳答案
您可能想查看 W3 常见问题解答:http://www.w3.org/MarkUp/2004/xhtml-faq#target
Why was the target attribute removed from XHTML 1.1?
It wasn't. XHTML 1.0 comes in three versions: strict, transitional, and frameset. All three of these were deliberately kept as close as possible to HTML 4.01 as XML would allow. XHTML 1.1 is an updated version of XHTML 1.0 strict, and no version of HTML strict has ever included the target attribute. The other two versions, transitional and frameset, were not updated, because there was nothing to update. If you want to use the target attribute, use XHTML 1.0 transitional.
关于html - XHTML Strict 1.0 - 目标 ="_blank"无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4666523/