Hypertext markup language (HTML) spacing is the use of coding to create a certain amount of blank space around words, paragraphs, images, or table cells in an HTML document. The tags for HTML spacing are visible only when a web programmer or designer is working with HTML in a plain text document or a web design software program. When a page is rendered in a web browser, the spacing tags are replaced with their designated measures of blank space. The most common tags for HTML spacing include the blank space tag, the margin adjustment tags, the line break tag, and the cell padding tags for spacing within tables. Correct use of HTML code for spacing is considered important for creating web pages with visually-appealing white space and clean-looking text.
One of the first spacing tags that most web page designers learn is the blank space tag. This tag uses an abbreviation for "nonbreaking space." Typing this HTML tag is a quick way to indent a paragraph or to move an anchored image into the desired position on a page. A singular blank space tag creates a small space increment before a word or image, so it usually needs to be typed about three times for proper paragraph indentation. One shortcut to this HTML coding is to copy the first tag and paste it into the HTML editor the required number of times.
The line break tags for HTML spacing are tags designed to control where the text on a web page breaks onto a following line. Since web browsers automatically wrap text after it reaches the far right side of a page, inserting the line break tags gives a web programmer control of where a new line of text starts. Enclosing a block of text in these tags designates a paragraph, and including margin tags also controls the amount of blank HTML spacing that frames a group of paragraphs on a web page.
A web programmer types margin tags for HTML spacing in the opening body tag of an HTML document. Margins at the top, bottom, and sides of a web page are measured in pixels, and most web browsers have default margins of 10. An opening tag that changes these margins is inserted with the desired number of margin pixels enclosed in the quotation marks. Spacing within an HTML table is known as cell padding because the designated white space pads the text or images in each table cell. Writing HTML code for table spacing is done by inserting a tag with the selected numbers of pixels designated in the quotes.