Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Level 1 - Week 2

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Level 1 - Week 2

Avatar for Graham Lewis

Graham Lewis

June 23, 2015

More Decks by Graham Lewis

Other Decks in Technology

Transcript

  1. CSS

  2. CSS • Cascading StyleSheets (CSS) defines the look of your

    web page by attaching style rules to your HTML tags • You can attach rules to: • tags • tags with an id attribute or • tags with a class attribute • There are different versions of CSS
  3. Where do you put your stylesheet? • Your stylesheet should

    be put into a seperate .css file • For now, put your .css file in the same directory as your .html file • Finally, add a link inside the <head> tag of your .html file to your .css file, like this... <head> <link rel="stylesheet" href="styles.css"> </head>
  4. CSS rules General form... selector { property : value; }

    ! the selector applies to all matching tags - selectors can have multiple property : value; pairs
  5. Changing fonts body { font-family: Helvetica, Arial, sans-serif; /* 'web

    safe' fonts */ font-size: 12pt; line-height: 1.25em; text-decoration: none; /* or line-through, overline, underline */ text-transform: none; /* or capitalize, full-width, uppercase, lowercase */ }
  6. Attaching rules to tag with an id attribute HTML... <h1

    id="say-hi">Hello World</h1> CSS... #say-hi { color: red; }
  7. Attaching rules to a tag with a class attribute HTML...

    <h1 class="say-hi">Hello World</h1> CSS... .say-hi { color: red; }