What’s HTML spacing?

Print anything with Printful



HTML spacing uses coding to create white space around text, images, or table cells. Common tags include white space, margin adjustment, line break, and cell padding. Proper use is important for visually appealing web pages.

Hypertext Markup Language (HTML) spacing is the use of coding to create a certain amount of white space around words, paragraphs, images, or table cells in an HTML document. HTML spacing tags are only visible when a web programmer or designer is working with HTML in a plain text document or web design software program. When a page is rendered in a web browser, the spacing tags are replaced with the designated amount of white space. The most common tags for HTML spacing include the white space tag, margin adjustment tags, line break tag, and cell padding tags for spacing within tables. Proper use of HTML 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 white space tag. This tag uses an abbreviation for “non-breaking space”. Typing this HTML tag is a quick way to indent a paragraph or move an anchored image to a desired location on a page. A single whitespace tag creates a small increment of space before a word or image, so it usually needs to be typed about three times for proper paragraph indentation. A shortcut to this HTML coding is to copy the first tag and paste it into the HTML editor the required number of times.

Line break tags for HTML spacing are tags designed to control where text on a web page breaks on a subsequent line. Since web browsers automatically wrap text after reaching the right side of a page, inserting line break tags allows a web programmer to control where a new line of text begins. Enclosing a block of text in these tags designates a paragraph, and the inclusion of margin tags also controls the amount of empty HTML spacing that frames a group of paragraphs on a web page.

A Web programmer types margin tags for HTML spacing into the opening body tag of an HTML document. The 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 quotes. Spacing within an HTML table is known as cell padding because the designated white space fills the text or images in each cell of the table. Writing the HTML code for table spacing is done by inserting a tag with the selected number of pixels indicated in quotes.




Protect your devices with Threat Protection by NordVPN


Skip to content