Skip to content

Links & Formatting Text

This content is not available in your language yet.

You can add a link to a page using the <a> element, and the href property.

<a href=”page2.html”>My second website</a>

The text “My second website” is what will be displayed, and the text inside the quotation marks is the link that the user will be redirected to when they click on it.

For this link to work on your page, you would need to have a file named page2.html located in the same directory as the current document.

There’s a few elements that can be used on text in HTML to apply different formatting to them. By surrounding text in these tags, you change how the browser renders the text.

TagDescriptionExample
<i>Puts the text in italics.Example
<small>Makes text smaller. Example
<mark>Highlights text. Example
<del>Strikes a line through text. Example
<ins>Underlines text. Example
<sub>Subscript text. Often used for scientific notation. Example
<sup>Superscript text. Often used for scientific notation. Example

As we talked about earlier, elements can be used inside other elements. So you have free choice to decide which words should have which text formatting features.

See this example. The page will only render the first sentence in italics.

<div><i>This is an HTML element.</i> It is being displayed on the Tūhura Tech Wiki page.</div>
This is an HTML element. It is being displayed on the Tūhura Tech Wiki page.

In this next example, multiple format options are used.

<div><i>This is an HTML element.</i> <ins>It is being <del>displayed</del></ins> on the <a href="https://wiki.tuhuratech.org.nz">Tūhura Tech wiki page</a>.</div>
This is an HTML element. It is being displayed on the Tūhura Tech wiki page.
Contribute Donate