Navigational Map Nav Reference 4.4 

4.4 Naming Conventions and Defining Styles in the CSS

Naming conventions in the CSS can be done in a variety of ways. You will come up with what is comfortable for you over time.

The element being modified is before the dot, and the class referenced in the XHTML is after the dot. For example, div.marine {color: darkblue;} would only change the color of text inside <div> tags with class="marine".

By not defining anything before the dot, e.g.: .blue { definitions }, you can use that style on any element. This is the convention used in this tutorial.

You need to be careful not to name classes by the same name, the second class definition will take precedence over the first, which can become very confusing.

Shorthand Descriptions in the CSS are preferable. For example, instead having separate descriptions for border-top, border-right, border-bottom, and border-left, you can have border: 1px 2px 3px 4px solid #CCCCCC;. This gives a solid gray border, 1px on top, 2px on the right, 3 px on the bottom, and 4 px on the left. With a little practice, the Shorthand Descriptions are much more convenient. This can be used on any description with multiple possible values. More descriptions will be covered in this tutorial.

4.4a Using CSS with DW MX 

<-- Previous Page - Nav Map - Next Page -->