Свойства CSS: Как установить высоту строки в процентах?
Перейти на страницу упражнений
Решение:
HTML-код:
<!DOCTYPE html>
<html>
<head>
<title>How to set the line height in percent</title>
<style type="text/css">
.small {
line-height: 80%;
}
.big {
line-height: 200%;
}
</style>
</head>
<body>
<p><strong>w3resource Tutorial</strong></p>
<p>Standard Line-height</p>
<p>CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents. In all the examples of our tutorials, we have used HTML for implementing CSS.</p>
<p>Smaller Line-height</p>
<p class="small">
CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents. In all the examples of our tutorials, we have used HTML for implementing CSS.
</p>
<p>Bigger Line-height</p>
<p class="big">
CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents. In all the examples of our tutorials, we have used HTML for implementing CSS.
</p>
</body>
</html>
Демонстрация в реальном времени:
Посмотрите строку-высота пера -ответа от w3resource ( @ w3resource ) на CodePen .
Поддерживаемый браузер
да | да | да | да | да |
Каков уровень сложности этого упражнения?
Новый контент: Composer: менеджер зависимостей для PHP , R программирования
disqus2code