[HTML] etiqueta base

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>标题</title>

    <!-- base标签为页面上的相对链接规定默认URL -->

    <!-- href和target与a标签相似 -->
    <base href="https://img-home.csdnimg.cn/images/" target="_blank">
</head>

<body>

    <!-- 下面的图片将会指定链接为 https://img-home.csdnimg.cn/images/20201124032511.png -->
    <img src="20201124032511.png">

    <!-- 下面的链接会默认在新窗口打开,因为base指定了target为_blank -->
    <a href="https://www.csdn.net">前往CSDN</a>

</body>

</html>

Supongo que te gusta

Origin blog.csdn.net/Tiezhu_Wang/article/details/114888309
Recomendado
Clasificación