Home > Web Front-end > HTML Tutorial > How to set a webpage to open in a new window

How to set a webpage to open in a new window

angryTom
Release: 2019-07-24 11:18:59
Original
11984 people have browsed it

How to set a webpage to open in a new window

Recommended tutorial: Html tutorial

Setting the web page to open the code in a new window

<a href="https://www.php.cn/" target="_blank">新窗口打开</a><br />
<a href="https://www.php.cn/" target="_parent">原窗口打开</a>
<a href="https://www.php.cn/" target="_self" >自身窗口打开</a>
<a href="https://www.php.cn/" target="_aa" >name="aa"的框架页面打开</a>
Copy after login

Extended information

The meaning of the Target attribute

The target attribute of the tag specifies where to open the link document.

If you include a target attribute within an tag, the browser will load and display the document in the frame or window named with the tag's href attribute and whose name matches the target. If the frame or window with the specified name or id does not exist, the browser will open a new window, give the window the specified tag, and then load the new document into that window. From now on, hyperlinked documents can point to this new window.

There are 4 reserved target names used for special document redirection operations:

_blank

The browser always loads the target document in a newly opened, unnamed window.

_self

The value of this target is the default target for all tags that do not specify a target, which causes the target document to be loaded and displayed in the same frame. Or as a source document in the window. This target is redundant and unnecessary unless used in conjunction with the target attribute in the tag of the document title.

_parent

This goal causes the document to be loaded into the parent window or frameset containing the frame referenced by the hyperlink. If this reference is in a window or in a top-level frame, it is equivalent to target _self.

_top

This goal causes the document to load into the window containing the hyperlink. Using the _top goal will clear all contained frames and load the document into the entire window. browser window.

Tip: All 4 values ​​of these targets start with an underscore. Any other window or object that begins with an underscore will be ignored by the browser, so do not use an underscore as the first character of any frame name or id defined in the document.

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

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