Multiple Style Rules

Multiple style rules can be applied within the declaration block by ensuring each style declaration terminates with a semi-colon ;


The declarations can be placed on single or separate lines:

<!DOCTYPE html>
		<title>Document Title</title>
			h1 { color: #F00; font-size: 2em; text-decoration: underline;}
			p { color: #00F;
				font-weight: bold;
				font-size: 10px;
		<h1>A fantastic heading styled on a single line.</h1>
		<p>A paragraph styled over multiple lines.</p>

Save & refresh browser:

A fantastic heading styled on a single line.

A paragraph styled over multiple lines.

Leave a Reply