红穆笔记
首頁 › 語言筆記 › css normalize.css是做什麼的?
語言筆記 CSS

css normalize.css是做什麼的?

css normalize.css是做什么的?

Normalize.css 使瀏覽器呈現所有 HTML 元素更加一致,並且符合現代 web 標準。Normalize.css 只作用於需要規範化的樣式。

Normalize.css只是一個很小的css文件,但它在磨人的HTML元素樣式上提供了跨瀏覽器的高度一致性。

相比於傳統的CSS reset,Normalize.css是一種現代的、爲HTML5準備的優質替代方案。總之,Normalize.css是一種CSS reset的替代方案。

/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* Document
   ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers.
 */

body {
  margin: 0;
}

/**
 * Render the `main` element consistently in IE.
 */

main {
  display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/* Grouping content
   ========================================================================== */

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/* Text-level semantics
   ========================================================================== */

/**
 * Remove the gray background on active links in IE 10.
 */

a {
  background-color: transparent;
}

/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Remove the border on images inside links in IE 10.
 */

img {
  border-style: none;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input { /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select { /* 1 */
  text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  vertical-align: baseline;
}

/**
 * Remove the default vertical scrollbar in IE 10+.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */

details {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Misc
   ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */

template {
  display: none;
}

/**
 * Add the correct display in IE 10.
 */

[hidden] {
  display: none;
}

微信赞赏

微信

支付宝赞赏

支付寶

✍️ 作者: 紅穆

網站管理員 · 感謝閱讀,更多精彩內容敬請關注

作者主頁 查看主頁 →

相關文章

css 定位(position)

css 定位(position) 語言筆記 CSS

語法:position:static | relative | absolute | fixed | center | page | sticky默認值:static適用於:除display屬性定義爲table-column-group | table-column之外的所有元素繼承性:無動畫性:否…
👁 339
css vh和vw自适应

css vh和vw自適應 語言筆記 CSS

  在移動端中利用REM的相對於根HTML進行改變,通過一段JS實現了移動端自適應,本文則使用純CSS視口單位來自行自適應,雖然現在的兼容性還沒法完全能夠接受,但不妨礙你認識這個vw和vh的強大。 響應式佈局的實現依靠媒體查詢( Media Queries )來實現,選取主流設備寬度尺寸作爲斷點針對…
👁 617

推薦閱讀

(PC+WAP)粉色家政服务公司网站模板 月嫂保姆网站源码下载 0077

(PC+WAP)粉色家政服務公司網站模板 月嫂保姆網站源碼下載 0077 實用收藏 pbootcms模板

一款粉色風格的家政服務公司PbootCMS網站模板,適用於月嫂、保姆、保潔等服務行業,支持PC和手機端。設計風格溫馨親切,能夠很好地傳達家政服務的貼心與專業。模板內置服務項目、人員展示與在線預約模塊,是家政公司獲客的重要工具。模板展示 安裝說明 網站後臺:/admin.php 賬號:admin 密碼…
👁 308
(PC+WAP)绿色QQ日志空间说说网站pbootcms模板 文章博客美文网站源码下载 0084

(PC+WAP)綠色QQ日誌空間說說網站pbootcms模板 文章博客美文網站源碼下載 0084 實用收藏 pbootcms模板

一款綠色風格的QQ日誌與空間說說文章博客模板,基於PbootCMS開發,支持PC與WAP端。設計風格清新文藝,非常適合美文分享、情感日誌及個人隨筆的發佈。模板閱讀體驗舒適,有助於個人博主或文學愛好者搭建屬於自己的文字天地。模板展示 安裝說明 網站後臺:/admin.php 賬號:admin 密碼:a…
👁 317
(PC+WAP)绿色化工材料企业网站pbootcms模板 营销型化工环保能源网站源码下载 0085

(PC+WAP)綠色化工材料企業網站pbootcms模板 營銷型化工環保能源網站源碼下載 0085 實用收藏 pbootcms模板

一套針對化工材料與環保能源行業的PbootCMS營銷型企業網站模板,採用綠色風格,支持PC和手機端。設計風格強調環保與科技,適合展示化工產品、能源解決方案及企業社會責任。有助於化工企業在線上樹立綠色品牌形象並吸引客戶。模板展示 安裝說明 網站後臺:/admin.php 賬號:admin 密碼:adm…
👁 276
(自适应手机版)响应式电梯扶梯类pbootcms模板 电梯生产企业绿色企业网站源码下载 0157

(自適應手機版)響應式電梯扶梯類pbootcms模板 電梯生產企業綠色企業網站源碼下載 0157 實用收藏 pbootcms模板

這套自適應手機版的響應式電梯扶梯類PbootCMS模板,採用綠色企業風格。設計風格專業環保,能夠展示電梯產品、維保服務與工程項目。有助於電梯生產或維保企業在線上樹立品牌形象,拓展樓宇與基礎設施建設市場。模板展示 安裝說明 網站後臺:/admin.php 賬號:admin 密碼:admin 解壓密碼:…
👁 239
(自适应手机端)响应式投资理财类网站pbootcms模板 金融机构财务管理类网站源码下载 0633

(自適應手機端)響應式投資理財類網站pbootcms模板 金融機構財務管理類網站源碼下載 0633 實用收藏 pbootcms模板

一款響應式投資理財與財務管理PbootCMS網站模板,支持PC與WAP端。設計風格現代金融,適合金融機構、財富管理公司展示投資產品與服務。有助於金融機構在線上吸引高淨值客戶,提升品牌形象。模板展示 安裝說明 網站後臺:/admin.php 賬號:admin 密碼:admin 解壓密碼:www.4s5…
👁 268
(独立手机版)单页落地页推广网站模板 - 带复制微信号 1016

(獨立手機版)單頁落地頁推廣網站模板 - 帶複製微信號 1016 實用收藏 pbootcms模板

一款獨立手機版單頁落地頁推廣PbootCMS網站模板,帶複製微信號功能。設計風格營銷導向強,適合微信營銷、社羣推廣等高轉化率落地頁。有助於企業快速搭建移動端推廣頁面,方便用戶複製微信號進行轉化。模板展示 安裝說明 網站後臺:/admin.php 賬號:admin 密碼:admin 解壓密碼:www.…
👁 286