Để đặt chiều cao dòng, hãy sử dụng thuộc tính line-height. Followng là các giá trị thuộc tính -
line-height: normal|number|length|initial|inherit;
Ví dụ
Bây giờ chúng ta hãy xem một ví dụ -
<!DOCTYPE html>
<html>
<head>
<style>
div {
line-height: 1.9;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>This is demo text.<br>
This is another demo text.
</p>
</div>
</body>
</html> Đầu ra
Ví dụ
Bây giờ chúng ta hãy xem một ví dụ khác -
<!DOCTYPE html>
<html>
<head>
<style>
div {
line-height: 200%;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>This is demo text.<br>
This is another demo text.
</p>
</div>
</body>
</html> Đầu ra