1.2 Embedding CSS

CSS can be added into the head section of a HTML document by using the <style> tag and the type attribute, like so:

<html>

<head>

<style type="text/css">

h1	{color::red;}

p	{font-size:14px;}

</style>

</head>

<body>

<h1>Headline Text</h1>

<p>Content text content text content text</p>

</body>

</html>

In this basic example, the styling for all h1 and p tags is defined just once within the head section. This means there is no need to specify the properties each time the tags are used in the body section (e.g. <h1> style="color:red;">content text</h1>).