CSS - Line Height

Here you learn how to code line height using CSS.

Line height formatting is really used to format line space - the space in between the lines of text on your page. The height of the line is defined in "ems" which is a unit of measure in CSS.

Line Height

External CSS File

This is your external CSS file named "sylesheet.css".


.linesmall { line-height: 0.9em; }
.linebig { line-height: 2.0em; }



PHP Page

<html>
<head>
<title>HTML tutorial</title>
<link rel=stylesheet type="text/css" href="/stylesheet.css">
</head>

<body>

<br>
<span class="linesmall">Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting.</span><br><br>

<span class="linebig">Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting.</span><br><br>

</body>

</html>



This is how it looks


Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting. Here is content styled with a 0.9 em setting.


Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting. Here is content styled with a 2.0 em setting.



 
Bookmark this page:
   
Rate this page:
  • Currently 2.83/5
  • 1
  • 2
  • 3
  • 4
  • 5

Rating: 2.8/5 (176 votes)



Comments:

please post comments
admin November 21, 2006

 
Nickname:
Comment:
Security: 1+1=
Hosts
Lunarpages.com Web Hosting
iPowerWeb

Domain Registrars
PPC Networks
Logos
Affiliate Networks
Resources