H I O X INDIA
FREE CSS Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

CSS Topics
Introduction
Types
Background Properties
Text Properties
Font Properties
BOX Properties
Border Properties
Margin Properties
Padding Properties
Special Topics
Ask Your Doubts
Feedback





CSS Line Height


Topic

How to set the line height in html using css?
I want to have a large space between each lines (line spacing), how?



Explanation


Property: Line Height

Usage:
line-height: 1cm;
line-height: 40px;
line-height: 40pt;
line-height: 200%;

Definition:
This will set the height of the line. It is the broadness / thickness of the line. So each line will be of the height set.
It takes the following values.
a)cm : The line height can be set in centimeter as 1cm or 2cm etc ...
b)px : The line height can be set in pixels as 1px or 10px etc ...
c)pt : The line height can be set in points as 1pt or 10pt etc ...
d)% : The line height can be set in percent as 200% or 500% etc .... If 100% means original size.

Example 1:
<div style="background-color: lime; line-height: 1cm;">
testing line height - line 1 <br>
testing line height - line 2 <br>
</div>

Result:
testing line height - line 1
testing line height - line 2

Example 2:
<div style="background-color: lime; line-height: 80px;">testing line height<br>
testing line height - line 2 <br>
</div>



Result:
testing line height
testing line height - line 2

Example 3:
<div style="background-color: lime; line-height: 20pt;">testing line height<br>
testing line height - line 2 <br>
</div>

Result:
testing line height
testing line height - line 2

Example 4:
<div style="background-color: lime; line-height: 200%;">testing line height<br>
testing line height - line 2 <br>
</div>

Result:
testing line height
testing line height - line 2







A Note
CSS - Cascading Style Sheets can be used along with html tags as explained in this site. This simple CSS will help you to create much elegant and neat html web pages. This does not need any additional softwares or codings. All web browser are capable of handing CSS codes.

Note 2: If required you can using <span> instead of <div> tags. div tag will start and end on new lines. span will not exceed the tag area.


privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com