Home > Web Front-end > HTML Tutorial > How to open a new window by clicking on a link in HTML

How to open a new window by clicking on a link in HTML

王林
Release: 2020-11-30 15:47:21
Original
20511 people have browsed it

htmlHow to click a link to open a new window: This can be achieved by using the target attribute of the a tag, such as [target="_blank"]. The target attribute specifies where to open the linked document, and _blank indicates opening the linked document in a new window.

How to open a new window by clicking on a link in HTML

The operating environment of this tutorial: Windows 10 system, HTML5 version. This method is suitable for all brands of computers.

(Learning video sharing: html video tutorial)

Attribute introduction:

Where is the target attribute of the tag? Open the linked document.

Syntax:

<a target="_blank|_self|_parent|_top|framename">
Copy after login

Attribute value:

  • _blank Open the linked document in a new window.

  • _self Default. Open the linked document in the same frame.

  • _parent Open the linked document in the parent frameset.

  • #_top Open the linked document in the entire window.

  • #framename Open the linked document in the specified frame.

Implementation:

<a href="abc.html" target="_blank">点击这里</a>
Copy after login

Related recommendations: html tutorial

The above is the detailed content of How to open a new window by clicking on a link in HTML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template