<style> Element

  • Defines style for the document
  • Used within the <head> tags of the document

 

Some hideous styling applied:

<!DOCTYPE html>
<html>
	<head>
		<title>My Document Title</title>
		<style type="text/css">
			body {background-color:#FFFF00; text-align:center;}
			h1 {color:#0000FF}
			p {font-weight:bold; color:#FF0000}
		</style>
	</head>
	<body>
		<h1>My Heading</h1>
		<p>My paragaph text</p>
	</body>
</html>

Save & refresh browser:

My Heading

My paragaph text

Leave a Reply