Меню
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON PHP КАК СДЕЛАТЬ
     ❯   

CSS Справочники


CSS Свойства





line-height



Example

Set the line height for different <div> elements:

div.a {
  line-height: normal;
}

div.b {
  line-height: 1.6;
}

div.c {
  line-height: 80%;
}

div.d {
  line-height: 200%;
}
Try it Yourself »

Definition line-height

The line-height property specifies the height of a line.

Note: Negative values are not allowed.

Show demo ❯

Default value: normal
Inherited: yes
Animatable: yes. Read about animatable Try it
Version: CSS1
JavaScript syntax: object.style.lineHeight="30px" Try it

Browser Support line-height

The numbers in the table specify the first browser version that fully supports the property.

Property
line-height 1.0 4.0 1.0 1.0 7.0


CSS Syntax line-height

line-height: normal|number|length|initial|inherit;

Property Values line-height

Value Description Demo
normal A normal line height. This is default Demo ❯
number A number that will be multiplied with the current font-size to set the line height Demo ❯
length A fixed line height in px, pt, cm, etc. Demo ❯
% A line height in percent of the current font size Demo ❯
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

More Examples line-height

Example

Set the line height in pixels and centimeters for different <div> elements:

div.a {
  line-height: 10px;
}

div.b {
  line-height: 30px;
}

div.c {
  line-height: 0.5cm;
}

div.d {
  line-height: 1cm;
}
Try it Yourself »
Example

Set the line height as a number for different <div> elements:

div.a {
  line-height: 0.5;
}

div.b {
  line-height: 1.6;
}

div.c {
  line-height: 2;
}
Try it Yourself »

Related Pages line-height

CSS tutorial: CSS Text Spacing

HTML DOM reference: lineHeight property



×

Связаться с отделом продаж

Если вы хотите использовать услуги schoolsw3 как образовательное учреждение, команда или предприятие, отправьте нам электронное письмо:
sales@schoolsw3.com

Сообщить об ошибке

Если вы хотите сообщить об ошибке или внести предложение, отправьте нам электронное письмо:
help@schoolsw3.com

Schoolsw3 оптимизирован для обучения и подготовки. Примеры могут быть упрощены для улучшения чтения и обучения. Учебники, ссылки и примеры постоянно проверяются, чтобы избежать ошибок, но мы не можем гарантировать полную правильность всего контента.
При использовании Schoolsw3 вы соглашаетесь прочитать и принять наши условия использования,
политику использования файлов cookie и конфиденциальности.

Авторское право 1999- © Copyright. Все права защищены. Schoolsw3 работает на SW3.CSS.