I am using <span class="class-name"></span>
repeatedly in my project. Something like this:
...
<span class="class-name"></span>
Some text generated here
<span class="class-name"></span>
Some text generated here
<span class="class-name"></span>
...
The purpose of the <span>
is to have a padding-right
so the text after it will be displayed nicer.
The problem is Chrome Browser can not render the empty <span>
so it converts it to something like this:
<span class="class-name">
Some text generated here
<span class="class-name">
Some text generated here
<span class="class-name">
</span>
</span>
</span>
Which this will not result in the output I am looking for. Because the paddings will be mixed up. The interesting thing is if you add a character like between the tags, the first view will be rendered by the browser and the problem is gone. Could anyone please explain why its working like this?
` elements trigger new lines by default anyway, so there wouldn't be any text to the right of the ``.
– Quentin Jul 25 '17 at 10:54. The process is more complecated than this. The code is written in .xml files and then its converted to html and some text is generated in the span.
– Hodaut96 Jul 25 '17 at 10:55