We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Software

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What Is HTML Spacing?

By Angela Farrer
Updated: May 17, 2024

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.

WiseGeek is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
Share
https://www.wisegeek.net/what-is-html-spacing.htm
WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.