Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Formatting Elements | Understanding Basic Elements
HTML for Beginners

book
Formatting Elements

Sometimes you want to bold a text or write italic text. Codes should be displayed differently from ordinary texts. You can use formatting elements.

All elements are inline elements. So you can use them inside the <p> tag or other elements without any problem. Let's try them out.

Bold text & Strong text

You can bold a text with the <b> tag.

html

index.html

copy
<b>This is a bold text</b>

If you want to write important text, use the <strong> tag.

html

index.html

copy
<strong>This is an important text</strong>

Italic text vs Emphasized text

We write italic text when we quote something from a different source. You can write italic texts with the <i> tag.

html

index.html

copy
<i>This is an italic text</i>

We use the <em> tag to write emphasized texts. Emphasized texts are also displayed in italic. However, you should use these elements according to their semantic meanings.

html

index.html

copy
<em>This is an emphasized text</em>

Subscripts and Superscripts

We need subscripts and superscripts, especially when we do academic writing. You can add subscript texts with a <sub> tag and superscript text with a <sup> tag.

html

index.html

copy
<p>This is a <sub>subscript</sub>text.</p>

More formattings

There are a few other formattings that you will need occasionally.

You can use the <small> tag to display smaller text.

html

index.html

copy
<p>This is a <small>small</small> text.</p>

You can use the <mark> tag to display a marked text.

html

index.html

copy
<p>This is a <mark>marked</mark> text.</p>

Also, you can use the <code> tag to display codes.

html

index.html

copy
<code> x = 10; y = 6; z = x + y; </code>

1. Which element is similar to the tag?

2. Which element is similar to the tag?

question mark

Which element is similar to the tag?

Select the correct answer

question mark

Which element is similar to the tag?

Select the correct answer

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 4
We use cookies to make your experience better!
some-alt