Curriculum
Course: HTML Basic
Login

Curriculum

HTML Basic

HTML Introduction

0/1

HTML Editors

0/1

HTML Attributes

0/1

HTML Paragraphs

0/1

HTML Formatting

0/1

HTML Comments

0/1

HTML Favicon

0/1

HTML Page Title

0/1

HTML Iframes

0/1

HTML Java Script

0/1

HTML File Paths

0/1

HTML Symbols

0/1
Text lesson

HTML Links – The target Attribute

Normally, clicking a link opens the linked page in the same browser window. To alter this behavior, you can set a different target for the link using the target attribute.

The target attribute determines the location where the linked document will open.

Possible values for the target attribute include:

  • _self: This is the default setting, where the document opens in the same window or tab where the link was clicked.
  • _blank: This option opens the document in a new window or tab.
  • _parent: This choice opens the document in the parent frame of the current frame.
  • _top: Selecting this will open the document in the entire window, overriding any frames.

Example

<a href=”https://code7school.com/” target=”_blank”>Visit code7school.com!</a>

Absolute URLs vs. Relative URLs

Both examples above employ an absolute URL (a complete web address) within the href attribute.

A local link (a link to a page within the same website) is designated with a relative URL (excluding the “https://www” portion):

Example

<h2>Absolute URLs</h2>
<p><a href=”https://www.w3.org/”>W3C</a></p>
<p><a href=”https://www.google.com/”>Google</a></p>

<h2>Relative URLs</h2>
<p><a href=”html_images.asp”>HTML Images</a></p>
<p><a href=”/css/default.asp”>CSS Tutorial</a></p>

 

Click to Learn