When coding in HTML & PHP, line breaks get interpreted as a space character. This can be problematically when using a list in order to achieve a horizontal menu because the space changes the padding unpredictably. I use this workaround for this:
Note: The <li>
elements will have a display: inline(-block);
property.
<ul>
<li>...</li><?php
?><li>...</li><?php
?><li>...</li><?php
?><li>...</li><?php
?><li>...</li>
</ul>
This is really sad. I don't think it is supposed to be that way. I also don't want to mess up the code in a different way by say... add both </li>
and the next <li>
on one line (which is essentially the same as above).
Question: Is there a best practice solution for this?
tag in html – Parth Oct 19 '14 at 07:38