From the course: Dreamweaver CS5 Essential Training

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

The anatomy of a CSS rule

The anatomy of a CSS rule

Styles in CSS are made up of two parts: the selector and the declaration. The selector comes first and describes the element on the page that is to be controlled through this rule. Here we see what is known as an element selector, and it will be controlling all heading 1s in our current document. Next, we have the declaration. The declaration is contained within these curly braces, which essentially tell the browser that all properties contained within should be applied to the element identified by the selector. Inside the declaration, we have properties, and values. Notice that they are separated by a colon and then ended with a semicolon. This tells the browser to move on to the next property if there are any available. In this case, our rule will take all heading 1s on the page, make them Arial, 1.4 ems in size, and red. Now if you are brand-new to CSS, the syntax is going to look a little intimating, but by breaking down the syntax into its individual parts, it's easy to see how…

Contents