When the text is displayed from the follwing HTML there is a large space between the two line. How do i remove that space?
<pre style="font-family:arial;color:191970;font-size:10px;line-height:.1;">
Line 1 with one tab at the end
</pre>
<pre style="font-family:arial;color:191970;font-size:10px;line-height:.1;">
Line 2 with one tab at the end
</pre>
Why i am using tag? I place 2 tabs at the end of each line thats why i am using this tag
You can try changing the default value of white-space for <pre> tag from pre to pre-line . pre-line Sequences of whitespace are collapsed.
To create extra spaces before, after, or in-between your text, use the (non-breaking space) extended HTML character. For example, with the phrasing "extra space" using a double space, we have the following code in our HTML.
It turns out that's pretty simple: just use the line-height CSS property and then apply it. I have an example below. Then, you can apply that CSS class to your HTML. Now, the space between the lines changes.
you are using two <pre/>
tags for two lines. so you need to manage margine and paddings for the <pre/>
tag. line-height
is not enough. and remember to set the line-height
in em
values and set the initial font size and line-height at the document level as well.
by default pre tag is displayed as block, that is the reason. To over come this use following code in CSS
pre
{
display: inline;
}
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