News & UpdatesProgrammingWeb programming Store My Projects  CSS
Tutorial – 05 – Class & Id Selectors  CSS tutorials  Class and
id selectors can define different styles for the same type of
HTML element.  Class selectors  The class selector is recognized
by the period sign (.) followed by a class name. The class can
either be a general class that can be applied to any element or
a specific class that can only be applied to one type of
element. The specific class is defined by declaring the
element’s name before the period sign.  /* Selects all elements
with class="myclass" */ /* Selects all <p> elements with
class="myclass" */  To use a class rule the elements in the
document that it will apply to must be specified. This is done
using the class attribute with its value set to the class name.
<p class="myclass">  Class example  Say for example that the
text inside of some elements should be colored, but not for all
instances of the elements. The first step then is to add a
general class rule with a color prope