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 the tag specifies where to open the link document.
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
_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!