<a>标签的target属性
时间: 2024-06-02 08:02:16 浏览: 10
`<a>`标签的`target`属性用于指定链接文档的打开方式。常用的取值有:
- `_self`:在当前窗口打开链接(默认值);
- `_blank`:在新窗口打开链接;
- `_parent`:在父窗口中打开链接;
- `_top`:在顶层窗口中打开链接。
例如:
```html
<a href="http://www.example.com" target="_blank">打开新窗口</a>
```
这个链接会在新窗口中打开`http://www.example.com`页面。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![exe](https://img-home.csdnimg.cn/images/20210720083343.png)
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)