DEV Community

Sudharshan S
Sudharshan S

Posted on

1

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.

Top comments (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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay