w3schools    w3Schools
Search W3Schools :
   
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples About
ADVERTISEMENTS

XML Certification
Download XML editor
Custom Programming
 
Table of contents
CSS Basic
CSS HOME
CSS Introduction
CSS Syntax
CSS How To
CSS Background
CSS Text
CSS Font
CSS Border
CSS Outline
CSS Margin
CSS Padding
CSS List
CSS Table

CSS Advanced
CSS Dimension
CSS Classification
CSS Positioning
CSS Pseudo-class
CSS Pseudo-element
CSS Image Gallery
CSS Image Opacity
CSS Media Types
CSS Don't
CSS Summary

CSS Examples
CSS Examples

References
CSS2 Reference
CSS2 Print
CSS2 Aural
CSS Units
CSS Colors
CSS Colorvalues
CSS Colornames

CSS Quiz
CSS Quiz
CSS Exam

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

W3Schools Tutorials
W3Schools Forum

Helping W3Schools

 

CSS line-height Property


CSS Reference Complete CSS Reference

Definition

The line-height property sets the distance between lines.

Inherited: Yes

Note: Negative values are not allowed.


JavaScript Syntax

CSS properties can also be dynamically changed with a JavaScript.

Scripting Syntax: object.style.lineHeight="2"

In our HTML DOM tutorial you can find more details about the lineHeight property.

In our HTML DOM tutorial you can also find a full Style Object Reference.


Example

p

line-height: 1.4
}

p

line-height: 14pt

p

line-height: 140%
}  

Possible Values

Value Description
normal Default. Sets a reasonable distance between lines
number Sets a number that will be multiplied with the current font-size to set the distance between the lines
length Sets a fixed distance between the lines
% Sets a distance between the lines in % of the current font size


Try-It-Yourself Demos

Specify the space between lines using a percent value
This example demonstrates how to specify the space between the lines in a paragraph using a percent value.

Specify the space between lines using a pixel value
This example demonstrates how to specify the space between the lines in a paragraph using a pixel value.

Specify the space between lines using a number value
This example demonstrates how to specify the space between the lines in a paragraph using a number value.


CSS Reference Complete CSS Reference

 
EDUCATION
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification

W3Schools is for training only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user.
Copyright 1999-2010 by Xdayx. All Rights Reserved.