I've heard about CSS reset and I'm also aware of Normalize CSS which is a type of reset for browsers to render basic CSS in a standardized way.
Looking for the best solution in CSS, I had the doubt: Which one to use?
I've heard about CSS reset and I'm also aware of Normalize CSS which is a type of reset for browsers to render basic CSS in a standardized way.
Looking for the best solution in CSS, I had the doubt: Which one to use?
The purpose of the reset files for css
is nothing more than what the name already says, reset the default style that some elements have.
For example, the buttons have a gray background, the lists have markings on the sides, titles have borders, tables have borders, etc.
All of these are native styles of the elements. These reset files will "delete" these styles OVERLAPPING with the css
contained in this reset.css
.
For example:
button {
border:none;
background:transparent;
}
This code css
will make the buttons no longer have this style.
The reason for using reset
would be to prevent default properties from interfering with the layout you are creating. If you use a button itself that has bright colors, etc. It will not look nice with a gray button, or it will not be the same size. So one of the reasons would be visual enhancement.
Another reason would be STRUCTURAL improvement. See the image below:
Thisisatablewiththedefaultstyle.Besidestheunattractivelook,notethatithasundesirableedges,whichwilldisruptitsstructure.Toremovetheseborders,weusereset
forthetable.
Thereisnoreset
betterthantheother,northerightonetouse,northerestrictiontouseonlyone,onlyanother,oreventousemorethanoneatthesametime.Whatyoushoulddoisanalyzewhatyouneedandhowmuchyouneedto'clear'fromthedefaultcode.Manyofthemwillcreateacss
forelementsyouoftenwillnotevenuse.
I,inparticular,gottothepointofnotusinganypredefinedreset.ImyselfremovethedefaultstylesfromtheelementsIuseandneed.
Tocomplementyourreading,IfoundtheselinksthatIfoundinteresting:
Reset
A reset as its name says will reset all browser default settings, so you can set your own css, without using the features that each browser uses.
Normalize
Normalize as the name itself will normalize, that is, it will attempt to leave the standardized styles in all browsers.
So if you want to set your own css
without interference from the rules defined by the browser use reset
, if you want to start based on something that already has high compatibility in browsers
and adding your rules Normalize
will be better.
I leave an additional literature on the subject: