/    /  CSS units

CSS units

 

CSS has multiple units for expressing a length. Many CSS properties take “length” values, such as width, margin, padding, font-size, height, etc.

 

Example:

 

<!DOCTYPE html>
<html>
<head>
<style>
h1 {
 font-size: 60px;
}

p {
 font-size: 25px;
 line-height: 50px;
}
</style>
</head>
<body>

<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

</body>
</html>

 

OUTPUT:

 

CSS units