asp.net.ph

Skip Navigation Links

line-height Attribute | lineHeight Property

CSS Attributes Index   Text Attributes


Sets or retrieves the distance between lines in an object.

Syntax


CSS { line-height: 'normal' | number | length | percentage }
Script object.style.lineHeight = sHeight ]

Possible Values


normal Default height.
number Floating-point number.
length Floating-point number and a valid CSS length unit: either an absolute units designator ( cm, mm, in, pt, pc, or px ) or a relative units designator ( em or ex ).
percentage Value expressed as a percentage of the parent object’s height.

The property is read/write with a default value of normal; the cascading stylesheet ( CSS ) attribute is inherited.

Remarks

Line height is the distance between the descender of the font to the top of the internal leading of the font. A negative line height is allowed to achieve various shadowing effects.

If there is more than one object on a formatted line, the maximum line height applies. In this case, negative values are not allowed.

Microsoft® Internet Explorer® 3.0 supports the line-height attribute through the font attribute.

Example

The following example demonstrates the effects of applying user-supplied values with the various length units possible for the CSS line-height attribute. This demo requires Microsoft® Internet Explorer® 4 or later.

 Show me 

The sample below uses inline event handlers to dynamically control an object’s lineHeight property in response to mouse events.

<p onmouseover="this.style.lineHeight='10mm'"
   onmouseout="this.style.lineHeight=''">
   ...
</p>

 Show me 

See Also

letter-spacing



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note