Example - Style Attribute

Previous page...

Style Attribute

The style attribute can be applied to the Elements (tags) within the body of the document.
In this example the style attribute is used to control the colour for items such as:

Paragraph Blue

Bold Maroon

Italic Green

Small Red

  • List Item Blue
  • List Item Green
  • List Item Teal

Remember to use the American spelling of color!

The HTML

	
	
<html>

<head>
	<title>Style Attribute</title>
</head>

<body style="color:Navy;">

<h2 style="color:CornflowerBlue;">Style Attribute</h2>
	
The style attribute can be applied to the Elements (tags) within the body
of the document. In this example the style attribute is used to control
the colour for items such as:

<p style="color:Blue;">Paragraph Blue

<p><b style="color:Maroon;">Bold Maroon</b>

<p><i style="color:Green;">Italic Green</i>

<p><small style="color:Red;">Small Red</small>

<ul>
	<li style="color:Blue;">List Item Blue
	<li style="color:Green;">List Item Green
	<li style="color:Teal;">List Item Teal
</ul>

<p><i><b style="color:Red;">Remember to use the American
spelling of color!</b></i>

</body>

</html>	
		

Back to Top of Page

© 2003 Ashley Preston 

Computeach International Ltd