welcome to css

CSS is a language that we create declarations about how content is display.

keywords:

  • properties: an identifier that indicates which stylistic feature we want to change. Each property will have a value.
  • declaration: a set of properties and values that are applied to HTML
  • selector: how we define what elements in the HTML have those properties
  • rule: a declaration and a selector
/* All p elements are red */
p {
  color: red;
}

/* All elements with the attribute 
    class="selected" are blue */
.selected {
  color: blue;
}

Simple CSS rulesĀ 

/* All p elements */

p {}

/* All elements with the attribute 
    class="selected" */

.selected {}

/* the element with the attribute
    id="top-choice" */

#top-choice {}

/* all h1 tags in a header*/

header h1 {}

/* all a,  em and elements 
    with the class="cat"*/

a, em, .cat {}

box model

time to code.

welcome to css

By Mark Dewey

welcome to css

  • 264