Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you reset/normalize your css using google material design (angular4)?

I am using angular material design at the moment. It does not reset the css like bootstrap. I have those whitespaces around my toolbar and edge of my browser.

I've checked some angular material design examples and some are using normalize css. Is it the right way to go with google material-design?

like image 945
Reşit Körsu Avatar asked May 16 '17 13:05

Reşit Körsu


People also ask

What is normalized CSS?

"Normalize. css is a small CSS file that provides better cross-browser consistency in the default styling of HTML elements. It's a modern, HTML5-ready, alternative to the traditional CSS reset." This component is a direct port of Normalize v1. 1.0 from the Normalize.

Should I use normalize or reset CSS?

Normalizing maintains useful defaults over non-stylizing everything and it won't clutter your dev tools window. Moreover, Resetting is meant to strip all default browser styling on elements. For e.g. margins, paddings, font sizes of all elements are reset to be the same.

What is the best CSS reset?

Normalize. CSS has been the most popular CSS reset library for years. It saves you a lot of time matching a duplicate experience for each web browser.

What's the difference between resetting and normalizing CSS which would you choose and why?

CSS resets aim to remove all built-in browser styling. Standard elements like H1-6, p, strong, em, et cetera end up looking exactly alike, having no decoration at all. You're then supposed to add all decoration yourself. Normalize CSS aims to make built-in browser styling consistent across browsers.


1 Answers

Yes using normalize css is a great option. It's what bootstrap uses anyways. Use the npm install for latest version: https://github.com/necolas/normalize.css/

  1. Install the normalize.css library:

    npm install --save normalize.css
    
  2. Import it in your styles.css

    @import '~normalize.css';
    
like image 190
Eeks33 Avatar answered Sep 21 '22 18:09

Eeks33