WDD 230: Web Frontend Development I

CSS Normalize and Reset

Overview

Every browser and its user agents have default CSS properties for HTML elements. As a web designer and developer, you may find it advantageous to provide a consistent starting point. The goal with a normalize or reset CSS reference is to reduce browser inconsistencies.

"Normalize.css makes browsers render all elements more consistently and in line with modern standards. It precisely targets only the styles that need normalizing." - Nicolas Gallagher

Prepare

Activity Instructions

  1. Create your own copy of a normalize CSS file by first creating a "normalize.css" file located in your wdd230 root "styles" folder.
  2. Use the following code reference and copy the CSS into your file. Nicolas Gallagher's - normalize.css
  3. Apply the CSS by including it in the head of your course home portal page.
  4. The following line of code should appear first in the CSS link reference cascade.
    <link rel="stylesheet" href="styles/normalize.css">
    Why should this CSS reference precede all the other CSS references?

    If you have more than one rule, all of which have exactly the same weight, then the one that comes last in the CSS will win.
    CSS Cascade and Inheritance - MDN
    CSS specificity - MDN

  5. An alternative to hosting your own normalize or reset CSS file is to use a content delivery network (CDN) reference.
    This particular reference has minimized the "normalize.css" file as indicated by the .min in the file name.
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
    Take a look at the file and see how difficult it is to read for humans but completely usable by the browser. 👀 File
    What does minimizing mean when it comes to web file optimization?

    All unnecessary syntax in the CSS is removed from the file including spaces, comments, line returns. More sophisticated minification would optimize the CSS and extract redundancy.

Submission

Save and then publish (commit and push) your home page to your wdd230 GitHub Pages repository.