DEV Community

Sudharshan S
Sudharshan S

Posted on

Comment out whitespace between inline elements

Inline display elements, usually such as span or a, will include up to one white-space character before and after them in the document. In order to avoid very long lines in the markup (that are hard to read) and unintentional white-space (which affects formatting), the white-space can be commented out.

If you trying without a comment between the inline elements, and there will be one space between them. Sometimes picking up the space character is desired.

Alt Text
Alt Text

In above image, we use both an HTML comment to nullify the newline character, and without it, you can notice a small formatting differences.

Discussion (1)

Collapse
normarood profile image
NormaRood

Inline display elements, usually such as span or a , will include up to one white-space character before and after them in the document. Vashikaran Mohini Mantra