Capital City Christian Church PluggedIn IT Ministry
Below you can see that the object type is first (in this case 'h1') and all of the declarations for that object type are enclosed in curly brackets. Each declaration starts with the characteristic's name (in this case 'color') followed by a full colon'. Then the value you want assigned to that characteristic is listed followed by a semi-colon. That is followed by a second declaration that the 'text-align' characteristic should be assigned or set to the value 'center', and then that ends with a semi-colon. And finally, all of the encapsulated declarations are closed with the curly bracket. From that point on, every 'h1' object will be displayed in the color 'orange' and will be 'center justified'.
In the following example the 'a' object (a href) is set to display a yellow background.
In this illustration, we see the top of an external file containing CSS declarations. Note that the first 2 lines (in green) are comments. A CSS comment starts with '/*', then continues until the end delimiter is found which is '*/', the inverse of the start delimiter. These can run for one line, a portion of a line, or several lines.
Next the 'body' object followed by the 'fieldset' objects are identified and given several declarations each.
In the next illustration, the 'p' object is identified, but in addition it has a class name of 'para' included. This allows us to have any number of 'p' object on a page, and they will all have the same declarations applied, except for the 'p' objects that in addition include a class identifier of 'para'. In those cases, the declarations in this block will be applied, even if that means overriding any previous declarations. Notice the HTML code using each version of the 'p' object;
This is an example of a normal p object without a class.
This p object however does include the class name 'para'.