sanitize.css is a CSS library that provides consistent, cross-browser default styling of HTML elements alongside useful defaults.
npm install --save sanitize.css
Download
See https://csstools.github.io/sanitize.css/latest/sanitize.css
- Normalizes styles for a wide range of elements.
- Corrects bugs and common browser inconsistencies.
- Provides common, useful defaults.
- Explains what code does using detailed comments.
*, ::before, ::after {
box-sizing: border-box;
}
*, ::before, ::after {
background-repeat: no-repeat;
}
::before,
::after {
text-decoration: inherit;
vertical-align: inherit;
}
html {
cursor: default;
}
html {
word-break: break-all;
}
body {
margin: 0;
}
nav ol, nav ul {
list-style: none;
}
::selection {
background-color: #b3d4fc;
color: #000;
text-shadow: none;
}
audio, canvas, iframe, img, svg, video {
vertical-align: middle;
}
svg {
fill: currentColor;
}
table {
border-collapse: collapse;
}
button, input, select, textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
textarea {
resize: vertical;
}
a, area, button, input, label, select, summary, textarea, [tabindex] {
-ms-touch-action: manipulation;
touch-action: manipulation;
}
[aria-busy="true"] {
cursor: progress;
}
[aria-controls] {
cursor: pointer;
}
[aria-disabled] {
cursor: default;
}
Visually hidden content remains accessible
[aria-hidden="false"][hidden]:not(:focus) {
clip: rect(0, 0, 0, 0);
display: inherit;
position: absolute;
}
normalize.css and sanitize.css correct browser bugs while carefully testing and documenting changes. normalize.css styles adhere to css specifications. sanitize.css styles adhere to common developer expectations and preferences. reset.css unstyles all elements. Both sanitize.css and normalize.css are maintained in sync.
- Chrome (last 3)
- Edge (last 3)
- Firefox (last 3)
- Firefox ESR
- Opera (last 3)
- Safari (last 3)
- iOS Safari (last 2)
- Internet Explorer 9+
Please read the contribution guidelines in order to make the contribution process easy and effective for everyone involved.
- normalize.css - A cross-browser css foundation.
- opinionate.css - A supplement to normalize.css with opinionated rules
sanitize.css is a project by Jonathan Neal, built upon normalize.css, a project by Jonathan Neal, co-created with Nicolas Gallagher.