html 整个页面的链接都是新窗口打开
要让整个页面的链接在新窗口打开,你可以使用 target 属性。将所有的链接的 target 属性设置为 "_blank",这将告诉浏览器在新窗口中打开链接。
以下是一个示例:
<!DOCTYPE html>
<html>
<head>
<title>Open Links in New Window</title>
</head>
<body>
<a href="https://www.example.com" target="_blank">Example</a>
<a href="https://www.google.com" target="_blank">Google</a>
<a href="https://www.github.com" target="_blank">GitHub</a>
</body>
</html>
在上述示例中,所有的链接都具有 target="_blank" 属性。当用户点击链接时,浏览器会在新窗口中打开该链接的目标页面。
原文地址: https://www.cveoy.top/t/topic/h3L8 著作权归作者所有。请勿转载和采集!