CSS (Cascading Style Sheets) | CSS: Presentation Layer

Standards Based Development

css (Cascading Style Sheets) is a language for describing the appearance of web pages. css is used in conjunction with html, as it define's the appearance and location of the html elements within the documents.

Made With Cascading Style Sheets

css is a declarative language for assigning styles to elements.

Resources

css Rule Declaration and Declaration Block

Diagram of a CSS Rule Declaration and Declaration Block

Declaration

A declaration is made up of a property and a value (ex. color:#ff0).

Declaration Block

A declaration block is the entirety of declarations contained within curly brackets, each separated by semicolons.

When a selector is placed in front of a declaration block, a css rule has been created.

css Tools

Made With CSS!

Valid CSS!

Valid CSS!

Made with CSS!

CSS OS

CSS OM

css Subproperties

css Subproperties provide a list of properties that make up a larger property. Three basic types of properties: simple properties, convenience property, and composite properties:

css Simple Properties:

take a single value of a single type (or a single named constant, such as thin)

css Composite Properties:

are properties that take multiple values of different types, like border.

Composite properties also have related subproperties, for example: the second parameter in the border property is equivalent to border-width. Thus, any value that is appropriate for border-width is also appropriate for the width portion of the border composite property.

The types allowed for a subproperty are also allowed for convenience properties and the appropiate portions of composite properties that contain them.

css Convenience Properties:

border-width is an example; properties that combine multiple properties of the same type into a single value. Many also allow you to optionally set distinct values for each of the included properties.

Convenience properties have related subproperties with finer granularity. Example, instead of setting border-width, you could set border-bottom-width, border-top-width, border-left-width, and border-right-width properties to the same value and achieve the same result.

Convenience properties can be broken down into subproperties of the same basic type, so any value that is legal for all of the subproperties is also legal for the convenience property as a whole if the property has a single-value form, and for the individual parts of the property has a multiple-value form. For example, you can set border-width property to accept the value thin even though it is listed only in related subproperties such as border-bottom-width. Similarily, you could use a multiple-value form, such as border-width: thin thin thin thin.

Safari css Reference: Explanation of Terms