当前位置: 移动技术网 > IT编程>网页制作>CSS > html中base标签的作用(代码讲解)

html中base标签的作用(代码讲解)

2019年06月02日  | 移动技术网IT编程  | 我要评论

于志安,王爷我们离婚吧,乾隆大帝二月河

base标签的作用就是,当页面中的a超链接标签没有设置href属性的值和没有设置target属性的值时,默认使用base标签中的href属性的值和target属性的值!

直接上代码!

<!doctype html>  
<html>  
<head>  
<meta charset="utf-8">  
<title>base标签</title>  
<link rel="stylesheet" type="text/css" href="css/body.css" media="all">  
<link rel="stylesheet" type="text/css" href="css/mark.css">  
<base href="https://blog.csdn.net/czh500/article/details/53451373">  
<base target="_blank">  
</head>  
<body>  
    <p align="center">  
        <h2>base标签</h2>  
        base标签的作用就是,当页面中的a超链接标签没有设置href属性的值和没有设置target属性的值时,默认使用base标签中的href属  
        性的值和target属性的值<br><br>   
        <a href="">测试1</a><br><br>   
        <a href="">测试2</a><br><br>   
        <a href="">测试3</a><br><br>  
        <a href="">测试4</a><br><br>  
        <a href="https://www.baidu.com" target="_self">测试5</a><br><br>  
        <a href="https://blog.csdn.net/czh500">测试6</a><br><br>  
    </p>  
</body>  
</html>  

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网