New window opens."/> New window opens.">

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

How to set a webpage to open in a new window

angryTom
angryTomOriginal
2019-07-24 11:18:5911935browse

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>

Extended information

The meaning of the Target attribute

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

If you include a target attribute within an 3499910bf9dac5ae3c52d5ede7383485 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 3499910bf9dac5ae3c52d5ede7383485 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 dde6fb694e6711ae5e6f381704c04ae4 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!

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:What is htmlNext article:What is html

Related articles

See more