Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Monospace Element
Monospace Element

The content of a monospaced element is monospaced text. Most of the fonts are known as variable-width fonts because different letters are of different widths (for example, the letter 'h' is wider than the letter 'i'). In a monospaced text, however, each letter has the same width.

Syntax

<tt>Content</tt>


You can apply tt element to any element and use any where within a HTML document.


Example

Monospaced text

Monospaced is a pair tag and output of tt element is monospaced text like you can see in above example.


Practice Task

Open notepad or any other text editor, follow the following points.


  • Use <tt> element and write some text inside it

save file with name task.html or task.htm and then open it using any browser and see results.


Solution

I am monospaced text

Don't forget tt is non empty element which means it always comes in pair.