Videos
Check out our tutorial video series.
Master the art of spacing in HTML and emails with MailSlurp. Learn about HTML entities, non-breaking spaces, and alternative spacing methods.
There more to white-space than the spacebar. Computers have many ways of encoding space in documents, be they emails, PDFs, or HTML. The non-breaking space character ( character in HTML) is commonly used to separate strings and denote a string that should not be put onto a separate line after the space.
In HTML or emails containing HTML some characters need to be encoded as HTML entities in order to be read by a computer. These include currency symbols like or
or the less than or greater than symbols:
and
. The HTML entities are special strings that denote such characters. Here are some examples:
;
An   html entity is very common and stands for non-breaking space. Use it in HTML or emails to ensure a sentence is not split onto multiple lines or to ensure space based padding or text.
You can add space to HMTL in other ways to avoid the downsides of   non-breaking space characters. Here are some alternatives for spacing content.
There are many HTML entities for fine control of spacing. Here are just a few:
Does how thin the hair space shows depend on the age of the website?...
Emails are notoriously difficult to style and space content. For many years developers and email markerters have styled emails using tables and unfortunately that is still the case today. However table or css
properties let you space content quite accurately using HTML.
MailSlurp lets you send and receive emails using a powerful and free email API service. Create test email accounts and send utf-8 encoded emails that can be encoded safely for you. See the developer pages for more.
In conclusion, white-space in documents is not just limited to the spacebar, as computers have multiple ways of encoding space. HTML entities are special strings used to encode certain characters in HTML or emails, including non-breaking spaces, currency symbols, and less than or greater than symbols. While non-breaking spaces are useful for ensuring text remains on the same line, there are alternative methods of adding space to HTML such as using CSS margins, HTML tables, or other space characters.
Emails are still difficult to style and space content, but the use of table cellpadding or CSS padding properties can provide more accurate spacing. Finally, MailSlurp is a useful tool for sending and receiving emails with a powerful and free email API service.
Check out our tutorial video series.
Email and SMS guides for automation and testing.
View github project code for multiple languages.
Latest posts from the MailSlurp team.
Test, build, and automate messaging with a free MailSlurp account.