cascading stylesheets class and id1. cascading stylesheets and class previously we looked at applying css values to tag (selector) properties
this page describes how stylesheets can alter those values the easiest way to explain class is to think of it as making-up a descriptive word to describe the effect we want to create the example below forces any text between the <TT></TT> tags to be red in color and 8pt in size
however if the <TT></TT> tags are required to be a color other than red we can do this with a 'class' (a descriptive word preceded by a dot or period) the example below makes text between the <TT></TT> purple and 12pt in size
<TT class="purple">This is typwriter text with class</TT> other tags can share a class <B class="purple">This is bold text with class</B> 2. cascading stylesheets and ID stylesheet ID and class are almost the same thing except where a class is declared by being preceeded by a dot (period) an ID is preceeded by a # hashmark
<TT class="purple">This is typwriter text with class</TT> <TT ID="goblue">This is typwriter text with ID</TT> <B ID="goblue">This is bold text with ID</B> The ability to reuse the same class or id in multiple html tags can be a great timesaver
|
![]() css tutorial |