Science, Tech, Math › Computer Science How to Make Spaces in HTML Share Flipboard Email Print Science, Tech, Math PHP Programming Perl Python Java Programming Javascript Programming Delphi Programming C & C++ Programming Ruby Programming Visual Basic View More By Jennifer Kyrnin Jennifer Kyrnin Writer University of California University of Washington Jennifer Kyrnin is a professional web developer who assists others in learning web design, HTML, CSS, and XML. Learn about our Editorial Process Updated on September 11, 2020 Reviewed by Jon Fisher Reviewed by Jon Fisher Wichita Technical Institute Jonathan Fisher is a CompTIA certified technologist with more than 6 years' experience writing for publications like TechNorms and Help Desk Geek. Learn about our Editorial Process Adding a string of spaces to your HTML only to have them disappear because of the way HTML handles spaces is a frustrating, familiar experience for anyone who works in web design. An HTML space tag would be convenient for creating spaces, but the fact is that none exists.. The source of the problem is that HTML compresses all space characters—tabs, spaces, and carriage returns—to one character. If you want to indent your paragraphs, you can’t simply type five spaces and then begin the text. That doesn't mean you don't have any control over spaces in your HTML, however. Lifewire / Maddy Price Alternatives to the Nonexistent HTML Space Tag You have several options for creating and controlling white space on your webpages: The HTML <br> tag denotes a line break, like a carriage return in a word processing program. You'd use it at the end of each line of an address, for example, to get the block format people are accustomed to seeing. The <p> tag generates a paragraph break. It is applied to a section of text that is a block of text separated from nearby blocks of text by a blank space and/or first-line indent. The <pre> tag is used with preformatted text. It instructs the browser that the text is to appear exactly as written in the HTML file, including any spaces or blank lines. If you type five spaces inside <pre> tags, you get five spaces on the website.character The character creates a space that does not break into a new line. Two words that are separated by a non-breaking space always appear on the same line. The 	 and 	 characters create tab spaces in HTML. Unfortunately, they can't be used independently. Any time you want a tab in HTML, you'll either need to use one of these characters inside <pre> tags or fake it with CSS. You can also add space around text using Cascading Style Sheets (CSS). If you're looking to create spacing anywhere around a full block of text, this is absolutely the way to do it. CSS also affords plenty of stylistic controls for the text itself, making it the first choice for many web developers. Practice using these simple tags, noting the outcome of each. Getting around the lack of an HTML space tag isn't complicated if you get to know these quick methods. Cite this Article Format mla apa chicago Your Citation Kyrnin, Jennifer. "How to Make Spaces in HTML." ThoughtCo, Jul. 31, 2021, thoughtco.com/html-space-tag-3466504. Kyrnin, Jennifer. (2021, July 31). How to Make Spaces in HTML. Retrieved from https://www.thoughtco.com/html-space-tag-3466504 Kyrnin, Jennifer. "How to Make Spaces in HTML." ThoughtCo. https://www.thoughtco.com/html-space-tag-3466504 (accessed June 4, 2023). copy citation