maperun / prj-rev-bwfs-tea-cozy

0 stars 0 forks source link

Resets first #1

Open zannain opened 6 years ago

zannain commented 6 years ago

Put these resets at the top of your stylesheet

When writing CSS, make sure you are declaring resets first. Resets are when you give all element tags specific styles. You want to do this first because when you use 'classes' and 'ids' later in your page, CSS considers them to be more specific than elements and so those resets will be overwritten.

The purpose of resets is to also make sure that your webpage renders correctly cross-browser and by giving elements the same styles at the beginning of your stylesheet, this ensures that all browsers will have the same baseline to work with. So even if IE the default font is Helvetica but the default font for Chrome is Times New Roman, by saying h2: { font-family: Helvetica; } you will ensure that Chrome and any other browsers that have default fonts that are not Helvetica also have Helvetica to start with.

Further down your stylesheets though if you have an h2 tag with a class="tea" and your stylesheet has .tea { font-family: monospace; } the class styles will take precedence. You can read more about class specificity here