open new page html code example

Example 1: open page with html

<!DOCTYPE html>
## Code by Scratchy (Twitter @S_cratchy)
<html>
<body>

<a href="https://www.Google.com" target="_blank">Gooooooooogle!</a> 

</body>
</html>

Example 2: open link in new tab

<a href="https://www.google.com/" rel="noopener noreferrer" target="_blank">google.com</a>

dont use just target="_blank" without  rel="noopener noreferrer" 
It Makes Your Site Vulnerable to Phishing Attacks

Example 3: open link in a new tab hmtl

<a href="https://insert.url" target="_blank">The Website Linked</a>

Example 4: how to make a link in html that opens in a new tab

add attribute : target = "_blank"

Example 5: html new page

<!DOCTYPE html>
<html>

<head>

</head>

<body>

    <h1>The a target attribute</h1>

    <a href="https://www.w3schools.com" target="_blank">Visit W3Schools.com!</a>
    <p>thank you w3schools :)</p>
    <p>If you set the target attribute to "_blank", the link will open in a new browser window or a new tab.</p>

</body>

</html>

Tags:

Html Example