![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | CHANGELOG.md | 9 years ago | 4.1K | |
![]() | CONTRIBUTING.md | 9 years ago | 7.0K | |
![]() | LICENSE.md | 9 years ago | 1.1K | |
![]() | README.md | 9 years ago | 4.9K | |
![]() | package.json | 2 years ago | 1.9K | |
![]() | sanitize.css | 9 years ago | 9.7K | |
![]() | test.html | 9 years ago | 11K |
The best-practices CSS foundation.
sanitize.css is a CSS library that corrects broken and missing styles in all browsers, preserving useful defaults rather than unstyling everything. It’s developed alongside normalize.css, so every normalization includes the browsers or browser versions being targeted, and every opinionated change is marked and documented.
npm install --save sanitize.css
bower install --save sanitize-css
* {
background-repeat: no-repeat;
}
* {
box-sizing: inherit;
}
html {
box-sizing: border-box;
}
html {
cursor: default;
}
html {
font-family: sans-serif
line-height: 1.5;
}
body {
margin: 0;
}
nav ol, nav ul {
list-style: none;
}
::selection {
text-shadow: none;
}
audio, canvas, iframe, img, svg, video {
vertical-align: middle;
}
svg {
fill: currentColor;
}
:hover {
outline-width: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
button, input, select, textarea {
background-color: transparent;
border-style: none;
color: inherit;
font-size: 1em;
}
textarea {
resize: vertical;
}
[aria-busy="true"] {
cursor: progress;
}
[aria-controls] {
cursor: pointer;
}
[aria-disabled] {
cursor: default;
}
a, area, button, input, label, select, textarea, [tabindex] {
-ms-touch-action: manipulation; /* 1 */
touch-action: manipulation;
}
[hidden][aria-hidden="false"] {
clip: rect(0, 0, 0, 0);
display: inherit;
position: absolute;
}
[hidden][aria-hidden="false"]:focus {
clip: auto;
}
sanitize.css styles elements more consistently with developers’ expectations and preferences. normalize.css styles elements more consistently between browsers. reset.css unstyles every element. Both sanitize.css and normalize.css are maintained in sync, and both projects correct browser bugs while carefully testing and documenting every change.
At present, sanitize.css supports the current and previous major releases of popular web browsers. When a new version is released, we begin supporting that newer version and stop supporting the third version back. Additionally, many older browsers remain supported without supplementary CSS.
Currently tested and supported browsers in the latest release include Android 4.3-4.4+, Chrome 50-51+, Edge 12-13+, Firefox 46-47+, Internet Explorer 10-11, iOS 7-8+, Opera 37-38+, Safari 8-9+, and Windows Phone 8.1+.
Additionally tested and supported browsers (requiring little supplementary CSS) include Internet Explorer 9 and Safari 7.
sanitize.css is dedicated to the public domain.