Home  >  Article  >  Web Front-end  >  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

王林
王林Original
2020-11-25 14:43:5820465browse

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:

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

Syntax:

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

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>

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!

Statement:
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
Previous article:Is html a web page file?Next article:Is html a web page file?