How to open hyp...LOGIN

How to open hyperlinks

The opening methods are divided into opening on this page and opening in a new browser window. By default, the way a hyperlink opens a new page is self-overwriting (that is, opening on this page). According to the different needs of the browser, readers can specify other ways of opening new windows for hyperlinks. The hyperlink tag provides the target attribute for setting, and the values ​​are _self (self-overwriting, default) and _blank (create a new window to open a new page). Let's start by distinguishing the difference between these two attributes (since we have already written about the default situation, here we only add the _blank attribute)

Based on the previous ones, we will add in < a> Add the target attribute to the tag: target="_blank"

QQ截图20161010175615.png

By comparing with the first picture, we can see that after the _blank attribute is added, the webpage linked to is in Opened in a new window, and the default _self attribute is opened in an overlay form on this page (first picture)


Next Section
<html> <body> <a href="http://www.php.cn/" target="_blank">Visit php!</a> <p>如果把链接的 target 属性设置为 "_blank",该链接会在新窗口中打开。</p> </body> </html>
submitReset Code
ChapterCourseware