HTML questions <p> and <span>

How can I get the following HTML code:

<p><span></span></p> 

.. use vertical space? if the range has a character or space, vertical space is occupied.

Any way to do this using CSS?

-1
source share
2 answers

You can do:

 p span { display: block; height: 1em; } 

However, you must put the class in this range, so it does not affect everything else.

EDIT: inline-block will probably be better.

+4
source

You can set the minimum height in the paragraph:

 p { min-height:1.3em; } 

However, IE6 does not support the min-height property ... I do not have older versions of IE, so I can not verify this, but in modern browsers, the minimum height works fine. The value 1.3em represents the height of one line of text.

0
source

Source: https://habr.com/ru/post/989386/


All Articles