Convert Figma logo to code with AI

necolas logonormalize.css

A modern alternative to CSS resets

52,321
10,666
52,321
74

Top Related Projects

A tiny modern CSS reset

A best-practices CSS foundation

A drop-in collection of CSS styles to make simple websites just a little nicer

4,104

:cherry_blossom: a minimal css framework/theme.

1,696

CSS framework for dummies, without a single CSS class: nicely renders properly formatted HTML5 pages

4,952

MVP.css — Minimalist classless CSS stylesheet for HTML elements

Quick Overview

Normalize.css is a modern, HTML5-ready alternative to CSS resets. It makes browsers render all elements more consistently and in line with modern standards. The project aims to preserve useful browser defaults rather than erasing them, normalize styles for a wide range of HTML elements, correct bugs and common browser inconsistencies, and improve usability with subtle modifications.

Pros

  • Preserves useful browser defaults instead of erasing them completely
  • Normalizes styles for a wide range of HTML elements
  • Corrects bugs and common browser inconsistencies
  • Improves usability with subtle modifications

Cons

  • May not be necessary for all projects, especially those using modern CSS frameworks
  • Some developers prefer a more aggressive reset approach
  • Requires occasional updates to keep up with browser changes
  • May conflict with other CSS reset or normalization libraries if not used carefully

Code Examples

  1. Normalizing form elements:
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

This code normalizes the font properties and margins for form elements across browsers.

  1. Correcting the line-height in all browsers:
html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

This snippet sets a consistent line height and prevents font size adjustments after orientation changes in iOS.

  1. Removing the margin in IE 10+:
body {
  margin: 0;
}

This simple rule removes the default body margin in Internet Explorer 10 and later versions.

Getting Started

To use Normalize.css in your project, follow these steps:

  1. Download the normalize.css file from the GitHub repository or use a CDN.
  2. Include the CSS file in your HTML:
<link rel="stylesheet" href="path/to/normalize.css">
  1. If using npm, install the package:
npm install normalize.css

Then import it in your main CSS file:

@import 'normalize.css';
  1. Place the Normalize.css file or import before your own CSS styles to ensure it doesn't override your custom styles.

Competitor Comparisons

A tiny modern CSS reset

Pros of minireset.css

  • Smaller file size, leading to faster load times
  • More aggressive reset, providing a cleaner slate for custom styling
  • Simpler and more straightforward approach to CSS resets

Cons of minireset.css

  • Less browser compatibility support compared to normalize.css
  • Fewer opinionated defaults, requiring more manual styling
  • May remove some useful default styles that normalize.css preserves

Code Comparison

minireset.css:

html,
body,
p,
ol,
ul,
li,
dl,
dt,
dd,
blockquote,
figure,
fieldset,
legend,
textarea,
pre,
iframe,
hr,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}

normalize.css:

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

main {
  display: block;
}

The code comparison shows that minireset.css takes a more aggressive approach by resetting margins and paddings for many elements, while normalize.css focuses on specific adjustments to improve consistency across browsers.

A best-practices CSS foundation

Pros of sanitize.css

  • More comprehensive reset, including additional elements and properties
  • Includes opinionated defaults for better cross-browser consistency
  • Actively maintained with more frequent updates

Cons of sanitize.css

  • Larger file size due to more extensive resets
  • May require more customization to override opinionated defaults
  • Less widely adopted compared to normalize.css

Code Comparison

normalize.css:

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
}

sanitize.css:

*, ::before, ::after {
  box-sizing: border-box;
}
html {
  cursor: default;
  line-height: 1.5;
  -moz-tab-size: 4;
  tab-size: 4;
  -webkit-tap-highlight-color: transparent;
}

Both normalize.css and sanitize.css aim to provide a consistent starting point for web projects by addressing browser inconsistencies. normalize.css focuses on preserving useful browser defaults while correcting common bugs, while sanitize.css takes a more opinionated approach with additional resets and defaults.

normalize.css is widely adopted and has a smaller file size, making it a popular choice for projects that require minimal resets. sanitize.css offers more comprehensive normalization and includes modern CSS features, making it suitable for projects that need a more thorough reset and are willing to customize the defaults as needed.

The choice between the two depends on project requirements, desired level of normalization, and willingness to work with opinionated defaults.

A drop-in collection of CSS styles to make simple websites just a little nicer

Pros of Water.css

  • Provides a complete, ready-to-use styling solution out of the box
  • Offers a more opinionated design with a modern, minimalist aesthetic
  • Includes styling for a wider range of HTML elements

Cons of Water.css

  • Less flexible for custom designs due to its opinionated nature
  • Larger file size, which may impact page load times
  • May require more overrides to achieve a specific look

Code Comparison

Normalize.css focuses on normalizing default styles:

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

Water.css provides complete styling for elements:

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.4;
  max-width: 800px;
  margin: 20px auto;
  padding: 0 10px;
  color: #363636;
  background: #ffffff;
}

Normalize.css is better suited for projects requiring a clean slate for custom designs, while Water.css is ideal for quickly creating visually appealing websites with minimal effort. The choice between the two depends on the project's specific needs and the desired level of customization.

4,104

:cherry_blossom: a minimal css framework/theme.

Pros of Sakura

  • Provides a complete, opinionated design out of the box
  • Lightweight and minimal, with a focus on readability
  • Easy to implement with a single CSS file

Cons of Sakura

  • Less flexible for custom designs compared to Normalize.css
  • May require overriding styles for specific project needs
  • Not as widely adopted or maintained as Normalize.css

Code Comparison

Sakura:

html {
  font-size: 62.5%;
  font-family: serif;
}
body {
  font-size: 1.8rem;
  line-height: 1.618;
}

Normalize.css:

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
}

Sakura provides a complete styling solution with specific font sizes and families, while Normalize.css focuses on normalizing default styles across browsers without imposing a particular design.

Normalize.css is more widely used and maintained, offering a solid foundation for custom designs. Sakura, on the other hand, provides a quick and easy way to create a visually appealing website with minimal effort, but may require more customization for specific project needs.

Both projects serve different purposes: Normalize.css aims to create a consistent base for custom designs, while Sakura offers a ready-to-use, opinionated style for rapid development.

1,696

CSS framework for dummies, without a single CSS class: nicely renders properly formatted HTML5 pages

Pros of Tacit

  • Provides a complete CSS framework with pre-styled elements, not just normalization
  • Aims for a "no-CSS" look, making it easy to create simple, clean designs
  • Smaller file size (about 4KB) compared to Normalize.css (about 8KB)

Cons of Tacit

  • Less flexible for custom designs due to opinionated styling
  • May require overriding styles for more complex layouts
  • Not as widely adopted or maintained as Normalize.css

Code Comparison

Normalize.css:

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
}

Tacit:

body {
  font-family: sans-serif;
  line-height: 1.5;
  margin: 0;
  padding: 1em;
}

Normalize.css focuses on normalizing browser inconsistencies, while Tacit provides a complete styling solution. Normalize.css is more widely used and maintained, offering greater flexibility for custom designs. Tacit, on the other hand, offers a quick way to create simple, clean layouts without writing additional CSS, but may require more overrides for complex designs.

4,952

MVP.css — Minimalist classless CSS stylesheet for HTML elements

Pros of MVP

  • Provides a complete, opinionated CSS framework with pre-styled elements
  • Offers a more visually appealing default design out of the box
  • Includes responsive design features and mobile-friendly layouts

Cons of MVP

  • Larger file size due to additional styling and components
  • Less flexibility for custom designs, as it imposes a specific aesthetic
  • May require overriding styles for projects with unique design requirements

Code Comparison

MVP:

:root {
    --border-radius: 5px;
    --box-shadow: 2px 2px 10px;
    --color: #118bee;
    --color-accent: #118bee15;
    --color-bg: #fff;
    --color-bg-secondary: #e9e9e9;
    --color-secondary: #920de9;
    --color-secondary-accent: #920de90b;
    --color-shadow: #f4f4f4;
    --color-text: #000;
    --color-text-secondary: #999;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --hover-brightness: 1.2;
    --justify-important: center;
    --justify-normal: left;
    --line-height: 1.5;
    --width-card: 285px;
    --width-card-medium: 460px;
    --width-card-wide: 800px;
    --width-content: 1080px;
}

Normalize.css:

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

main {
  display: block;
}

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

normalize.css

Normalize Logo

A modern alternative to CSS resets

npm license changelog gitter

NPM

npm install --save normalize.css

CDN

See https://yarnpkg.com/en/package/normalize.css

Download

See https://necolas.github.io/normalize.css/latest/normalize.css

What does it do?

  • Preserves useful defaults, unlike many CSS resets.
  • Normalizes styles for a wide range of elements.
  • Corrects bugs and common browser inconsistencies.
  • Improves usability with subtle modifications.
  • Explains what code does using detailed comments.

Browser support

  • Chrome
  • Edge
  • Firefox ESR+
  • Internet Explorer 10+
  • Safari 8+
  • Opera

Extended details and known issues

Additional detail and explanation of the esoteric parts of normalize.css.

pre, code, kbd, samp

The font-family: monospace, monospace hack fixes the inheritance and scaling of font-size for preformatted text. The duplication of monospace is intentional. Source.

sub, sup

Normally, using sub or sup affects the line-box height of text in all browsers. Source.

select

By default, Chrome on OS X and Safari on OS X allow very limited styling of select, unless a border property is set. The default font weight on optgroup elements cannot safely be changed in Chrome on OSX and Safari on OS X.

[type="checkbox"]

It is recommended that you do not style checkbox and radio inputs as Firefox's implementation does not respect box-sizing, padding, or width.

[type="number"]

Certain font size values applied to number inputs cause the cursor style of the decrement button to change from default to text.

[type="search"]

The search input is not fully stylable by default. In Chrome and Safari on OSX/iOS you can't control font, padding, border, or background. In Chrome and Safari on Windows you can't control border properly. It will apply border-width but will only show a border color (which cannot be controlled) for the outer 1px of that border. Applying -webkit-appearance: textfield addresses these issues without removing the benefits of search inputs (e.g. showing past searches).

Contributing

Please read the contribution guidelines in order to make the contribution process easy and effective for everyone involved.

NPM DownloadsLast 30 Days