How can i use newlines in editor without having annoying spaces in my template?
There is an example of what i mean:
<nav id="navbar">
<ul>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
</ul>
</nav>
Fiddle1: newlines = annoying spaces
<nav id="navbar">
<ul><li><a href="#"></a></li><li><a href="#"></a></li><li><a href="#"></a></li><li><a href="#"></a></li></ul>
</nav>
Fiddle2: no newlines = perfect result
You could add float: left;
#navbar ul li {
float: left;
}
Fiddle: http://jsfiddle.net/zo492g3y/1/
A complete guide removing white space between inline-blocks could be found at: Fighting the Space Between Inline Block Elements.
use HTML comment, is another option if you want your code to be readable
<nav id="navbar">
<ul>
<li><a href="#"></a></li><!--
--><li><a href="#"></a></li><!--
--><li><a href="#"></a></li><!--
--><li><a href="#"></a></li>
</ul>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With