The Cascade

Contact Us or call 1-877-932-8228
The Cascade

The Cascade

Web designers can define style rules in three different places:

  1. In an embedded style sheet.
  2. In an external (or linked or imported) style sheet.
  3. Inline in an element.

Embedded Style Sheets

Embedded style sheets appear in the style element in the head of an HTML page. The code below shows a page with an embedded style sheet:

Code Sample:

CrashCourse/Demos/EmbeddedStyleSheet.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Embedded Style Sheet</title>
<style type="text/css">
	.warning {
		color: #ff0000;
	}
	h1.warning {
		text-decoration: underline;
	}
	p.warning {
		font-weight: bold;
	}
</style>
</head>
<body>
<h1 class="warning">WARNING</h1>
<p class="warning">Don't go there!</p>
</body>
</html>

As you can see, the <style> tag takes the type attribute, which is used to indicate that this is a CSS style sheet. This page will render as follows: Embedded Style Sheet

Next