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:
   
 
Shared Hosts
Lunarpages.com Web Hosting

Domain Registrars
PPC Networks
Logos
Affiliate Networks
Resources