Answers for "line-height not working on span"

0

line-height not working on span

<!--
	There are a few ways to overcome this issue... Setting the display
	value to "block" (or "inline-block") will allow the line-height style to
 	work... Or, you could use a <div> tag instead of a <span> tag...
-->

<!-- span is set to "display:block" -->
<span style = "display:block; line-height:12px">Yay, it works!</span>

<!-- using a div instead -->
<div style = "line-height:12px">Huh, this works too!</div>

<!--
	Happy coding, my homies! <3
-->
Posted by: Guest on February-14-2021

Browse Popular Code Answers by Language