红穆笔记
首頁 語言筆記 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之外的所有元素繼承性:無動畫性:否…
👁 119
css vh和vw自适应

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

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

推薦閱讀

资源网站typecho001模板

資源網站typecho001模板 程序筆記 Typecho

typecho001模板板本請勿修改本模板文件夾名稱 文件夾名稱爲:typecho001 1.4修復文章頁面js輸出問題1.3修復未安裝插件時的報錯提示優化列表頁代碼輸出1.2修復評論功能增加自定義首頁標題1.1修復評論回覆不對稱功能添加首頁單獨的標題設置功能增加網站favicon.ico圖標增加一…
👁 198
typecho分页样式的修改

typecho分頁樣式的修改 程序筆記 Typecho

大人,時代變了!目前typecho最完美的解決方案了,因爲百度只能看到固定思維的代碼。實際生成的html代碼,乾淨到讓人窒息完全的自定義,包括給li元素加上class,給a元素加上class,給上一頁下一頁加上class,去除typecho自帶用於表示更多的li標籤。甚至裏面的內容我也能添加一些文字…
👁 517
typecho文章页评论样式修改

typecho文章頁評論樣式修改 程序筆記 Typecho

需求使用 typecho 進行模板開發的時候,默認評論樣式很難看。因此需要評論需要重新輸出或進行樣式設定。默認的評論模板文件路徑是:comments.php主要使用的相關變量<?php $comments->gravatar('40', ''); ?> //頭像,有兩個參數,大小、…
👁 388
Typecho 对数据库的增删改查操作方法 API

Typecho 對數據庫的增刪改查操作方法 API 程序筆記 Typecho

Typecho數據庫提供了非常易用的api,和原生SQL寫法沒有太大的差別,同時也很好地處理了SQL常見的安全問題,如sql注入。本文從實用角度出發,介紹了typecho操作數據庫的常用場景以及相關api用法。表創建和刪除在Typecho插件開發過程中,往往需要創建自己的表。上文提到Typecho_…
👁 552
PHP ob函数记录

PHP ob函數記錄 語言筆記 PHP

下面3個函數的用法 ob_get_contents(); ob_end_clean(); ob_start(); 可以藉助這幾個函數實現緩衝本地文件,以及執行本地腳本代碼。 使用ob_start()把輸出的代碼存到緩衝區,頁面不會顯示出來; 然後用ob_get_contents得到緩衝區的數據。 o…
👁 141
Typecho调用热门评论文章和调用最新文章的方法总结

Typecho調用熱門評論文章和調用最新文章的方法總結 程序筆記 Typecho

Typecho文章調用Typecho程序在設計主題的時候,側欄有些時候需要調用熱評文章或者最新文章。我們可以在指定的位置通過腳本直接調用。在這篇文章整理這個調用文章的方法,以後在有需要的模板中可以直接調用使用。其實設計主題就那麼回事,靜態模板搞定後,就是直接調用。最新文章調用 <?php $t…
👁 295