Understanding Basic CSS Selectors
A selector represents a structure to target elements in your HTML document. Using a selector you can "style" your document's (webpage) presentation.
In this codecast we're going to cover:
- Universal Selector
- Type Selector
- Class Selectors
- ID Selectors
- Selectors with Descendant Combinators (whitespace)
- Selectors with Child Combinators (>)
- Selectors with Adjacent Sibling Combinators (+)
- Selectors with General Sibling Combinators (~)
When to use ids ?
Use id for major components of a page that do not appear more than once, since ids have to be completely unique. You cannot have 2 or more elements with the same value for the
When to use classes ?
Use classes when you want to apply same or similar styles to a set of elements. A very common example is a list of posts in the content area or widgets in the sidebar area on blogs (or other similar sites).
Warning: Invalid argument supplied for foreach() in /var/www/cssdeck/app/modules/labs/views/_details.php on line 68