The Use of Tabs in HTML

The HTML markup language allows web designers to format text, add spaces and tabs etc., in order to make the contents in a website appear distinct and legible. In HTML, spaces are characters which are added in words, sentences and paragraphs – both horizontally and vertically.

Here, the use of tabs in HTML markup is to add horizontal spaces between texts to as many as you want.

Adding Tabs In HTML

In HTML, ‘ ’, ‘ ’ and ‘ ’ tags are used as a proper format for adding tab spaces. These tags are commonly applied to sentences and paragraphs, respectively.

In the following examples, we shall see how these tabs are applied as spaces in HTML and CSS.

What These Tags Do

Let’s look at the purposes that are fulfilled by applying these tags in HTML.

  – adds a tab when inserted 4 times before or after a line or sentence.

  – adds 2 spaces when inserted before or after a line or sentence.

  – adds 4 spaces when inserted before or after a line or sentence.

Therefore, in order for a clear understanding on the usage on tabs in HTML, an example can be cited as follows:

<!DOCTYPE html>


<title>HTML Tips</title>



<h1><u><center>Demo On How To Apply Tabs In HTML</u></center></h1>

<p><b>Hello &nbsp;&nbsp;&nbsp;&nbsp; World!</b><br>

<br><i>The above example shows the use of a tabbed space between <b>"Hello"</b> and <b>"World!"</b> in HTML.</i></p><br>

<h1><u><center>The Same Example Can Also Be Represented As</u></center></h1>


<b>Example A:</b>

Hello &ensp; World!<br>

<br><i>The above example uses two spaces between the words <b>"Hello"</b> and <b>"World!".</i></b>



<br><b>Example B:</b>

Hello &emsp; World!<br>

<br><i>The above example uses four spaces between the words <b>"Hello"</b> and <b>"World!".</i></b>




As you can see from the above HTML markup language, the use of tabs have been well applied, taking the example of “Hello World!”. It is not complicated at all. Simply copy the above plain HTML markup and paste it into a text editor or a word processor application, then save the file with a “.html” extension. Now, when you open the “.html” file in a web browser, you will get the desired output. Try this out!

Thus, the example given above shows how tabs are added between words in a sentence or paragraph in plain HTML markup language.

Adding Tabs In CSS

We have seen from the example on how to add tabbed spaces in HTML markup without CSS. However, you can also add tabs in CSS for inserting spaces between words and sentences, respectively.

In contrast to HTML, CSS uses the following common ways in order to add spaces between words:

  • Margin
  • Padding
  • Text-indent

An example can be shown as follows:

p.first {

text-indent: 4em;

margin-bottom: 0;

padding-bottom: 0;


In the above example, the first paragraph will be indented with four characters of spacing.

Find Solutions and Support For HTML At Codexoxo – Contact

If you need solutions, or seek suggestions and guidance with regards to HTML markup language, then our team of HTML experts at Codexoxo are the best professionals to approach for assistance and guidance. You can contact our HTML experts on the toll-free phone number <enter-phone-number> for support with HTML markup language and get top suggestions on how to use it effectively in website designing.

Also, if you are a web designer or developer and need additional help working with HTML markup language, our professionals at Codexoxo are always willing to assist you any time and at your convenience. We render our services round the clock in order to cater to your web designing and development needs.

Call Now