How to insert spaces in HTML

This tutorial explains how to insert spaces and line breaks in HTML. Because no matter how many times you type a space, HTML will display a space so to insert more than one space, you will need to use the HTML tag.

How to insert spaces in HTML (non-breaking space)

Usually HTML only displays a space between words, no matter how many times you have typed it. To force the removed spaces to appear, type  go to the place you want to insert.

For example typing Xin chào. will create an extra space between Xin and Hello.

This is called a space that is not broken or not destroyed because it prevents the line from falling in that position. If you abuse this character, the browser will be difficult to insert a nice and proper line break.

Can type  to create space.

Insert longer spaces in HTML

You can use 1 of the following options:

  1. Insert 2 spaces:
  2. Insert 4 spaces:
  3. Insert tab:    

Back off the lines of CSS text

The Padding or Margin properties of CSS give direct instructions to the browser, so the result will be more consistent than using the tag 

In the paragraph of text, insert the code below:

 
4 ★ | 1 Vote

May be interested

  • Style HTML with CSSPhoto of Style HTML with CSS
    css is added to html elements in three ways: inline, internal and external.
  • Paths in HTMLPhoto of Paths in HTML
    you can find links (links) throughout the web. link allows clicking to switch to another page.
  • Image img in HTMLPhoto of Image img in HTML
    when you visit the website, you will often see images of all sizes and positions on the page. images in html web pages will help to enrich the content as well as increase the aesthetics of the page.
  • Table in HTMLPhoto of Table in HTML
    what does it take to create a table in html? is it complicated? want to add color to the table border, how to add the background color to the text in the table? in this article tipsmake.com will answer those questions and guide you to basic operations with tables on html, in addition to adding alternate color schemes for rows in the html table. invite you to follow along.
  • List in HTMLPhoto of List in HTML
    this tutorial explains how to create lists in html.