In the layout there is often a situation when, for example, you need to indent from the container to the text. If to the right and to the left it is quite simple to do this, then vertically it is more difficult to get into a pixel. That is, we take a ruler and look at the layout what is the distance from the border of the container to the capital letter of the text. But, if you set the internal indent in the container, it will be added to the line spacing of the text.
It is clearer to ask by example. I want my visual indent from the container to the text to be of a certain size from above and below and I do not want to depend on the font size.
* { padding: 0; margin: 0; } .container { padding: 20px; /* Нужен такой отступ до текста! */ /* Для наглядности */ color: white; background: black; width: 300px; font-size: 20px; /* Равен размеру шрифта, но отступ до следующей строки есть сверху и снизу. Можно ли как-то сделать только снизу? */ line-height: 20px; } /* Наглядно смотрим интервал */ .container span { background: gray; } <div class="container"> <span>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis atque maiores porro totam ipsum voluptatum cum similique, quam esse id eaque perspiciatis distinctio ex provident natus culpa maxime voluptate, dolorem.</span> </div> How to achieve this?