Insert this inside the <head> tag of your webpage:
<base target="_self">
This sets all hyperlinks on a webpage to open in the same window/tab you are on.
Your own hyperlinks won't need to add "_blank", write it without an extension:
<a href="http://myhomepage.com">
I have <base target="_self"> as the default on this page and for external hyperlinks I am using the "_blank" extension on the link itself:
<a href="targeting_rule.html"target="_blank">
Examples: | |
| Default hyperlinks in same window/tab: |
Click Here (Returns you right back to this page) |
| External hyperlinks to open in another window/tab |
Click Here (Close new window after seeing it in action) |
Rule of Thumb: When writing a hyperlink and you add the "http://" to the hyperlink, it is an external hyperlink.
Webmasters know by linking to another page on their website they don't use "http://"
Another Rule of Thumb: ALL external links should open in a new window/tab, do this by adding:
target="_blank"> on each external hyperlink while your own hyperlinks are left blank by default.
Attribute Values | |
| Value | Description |
|---|---|
| _blank | Opens the link in a new window or tab |
| _self | Default. Opens the link in the same frame as it was clicked |
| _parent | Opens the link in the parent frame |
| _top | Opens the link in the full body of the window |
| framename | Opens the link in a named frame |