返回介绍

normalize

发布于 2023-10-15 18:11:42 字数 5377 浏览 0 评论 0 收藏 0

用来归一化不同浏览器下的页面样式。

依赖于:
  • variables
  • compatibility
  • typography
  • .global-normalize()

    全局归一化页面样式,基于 normalize.css

    // global scope
    .global-normalize();
    /*! normalize.css v1.1.2 | MIT License | git.io/normalize */
    
    html {
    font-size: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    }
    
    html,
    button,
    input,
    select,
    textarea {
    font-family: "Helvetica Neue", Arial, sans-serif;
    }
    
    body {
    margin: 0;
    }
    
    a:focus {
    outline: thin dotted;
    }
    
    a:active,
    a:hover {
    outline: 0;
    }
    
    h1 {
    font-size: 2em;
    margin: 0.67em 0;
    }
    
    h2 {
    font-size: 1.5em;
    margin: 0.83em 0;
    }
    
    h3 {
    font-size: 1.17em;
    margin: 1em 0;
    }
    
    h4 {
    font-size: 1em;
    margin: 1.33em 0;
    }
    
    h5 {
    font-size: 0.83em;
    margin: 1.67em 0;
    }
    
    h6 {
    font-size: 0.67em;
    margin: 2.33em 0;
    }
    
    abbr[title] {
    border-bottom: 1px dotted;
    }
    
    b,
    strong {
    font-weight: bold;
    }
    
    blockquote {
    margin: 1em 40px;
    }
    
    dfn {
    font-style: italic;
    }
    
    hr {
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
    height: 0;
    }
    
    p,
    pre {
    margin: 1em 0;
    }
    
    code,
    kbd,
    pre,
    samp {
    font-family: Monaco, Consolas, monospace;
    font-size: 1em;
    }
    
    pre {
    white-space: pre;
    white-space: pre-wrap;
    word-wrap: break-word;
    }
    
    q {
    quotes: none;
    }
    
    q:before,
    q:after {
    content: "";
    content: none;
    }
    
    small {
    font-size: 80%;
    }
    
    sub,
    sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    }
    
    sup {
    top: -0.5em;
    }
    
    sub {
    bottom: -0.25em;
    }
    
    dl,
    menu,
    ol,
    ul {
    margin: 1em 0;
    }
    
    dd {
    margin: 0 0 0 40px;
    }
    
    menu,
    ol,
    ul {
    padding: 0 0 0 40px;
    }
    
    nav ul,
    nav ol {
    list-style: none;
    list-style-image: none;
    }
    
    img {
    border: 0;
    -ms-interpolation-mode: bicubic;
    }
    
    svg:not(:root) {
    overflow: hidden;
    }
    
    form {
    margin: 0;
    }
    
    fieldset {
    border: 1px solid #c0c0c0;
    margin: 0 2px;
    padding: 0.35em 0.625em 0.75em;
    }
    
    legend {
    border: 0;
    padding: 0;
    white-space: normal;
    *margin-left: -7px;
    }
    
    button,
    input,
    select,
    textarea {
    font-size: 100%;
    margin: 0;
    vertical-align: baseline;
    *vertical-align: middle;
    }
    
    button,
    input {
    line-height: normal;
    }
    
    button,
    select {
    text-transform: none;
    }
    
    button,
    html input[type="button"],
    input[type="reset"],
    input[type="submit"] {
    -webkit-appearance: button;
    cursor: pointer;
    *overflow: visible;
    }
    
    button[disabled],
    html input[disabled] {
    cursor: default;
    }
    
    input[type="checkbox"],
    input[type="radio"] {
    box-sizing: border-box;
    padding: 0;
    *height: 13px;
    *width: 13px;
    }
    
    button::-moz-focus-inner,
    input::-moz-focus-inner {
    border: 0;
    padding: 0;
    }
    
    textarea {
    overflow: auto;
    vertical-align: top;
    }
    
    table {
    border-collapse: collapse;
    border-spacing: 0;
    }
    
    article,
    aside,
    details,
    figcaption,
    figure,
    footer,
    header,
    hgroup,
    main,
    nav,
    section,
    summary {
    display: block;
    }
    
    audio,
    canvas,
    video {
    display: inline-block;
    *display: inline;
    *zoom: 1;
    }
    
    audio:not([controls]) {
    display: none;
    height: 0;
    }
    
    [hidden] {
    display: none;
    }
    
    mark {
    background: #ff0;
    color: #666666;
    }
    
    figure {
    margin: 0;
    }
    
    input[type="search"] {
    -webkit-appearance: textfield;
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
    }
    
    input[type="search"]::-webkit-search-cancel-button,
    input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    }
    
  • .global-normalize-opentype()

    全局归一化 OpenType 相关样式,基于 normalize-opentype.css

    // global scope
    .global-normalize-opentype();
    /*! normalize-opentype v0.1.2 | MIT License | kennethormandy.com/journal/normalize-opentype-css */
    
    html,
    body {
    font-feature-settings: "kern" 1, "liga" 1, "pnum" 1, "tnum" 0, "onum" 1, "lnum" 0, "dlig" 0;
    }
    
    h1,
    h2,
    h3 {
    font-feature-settings: "kern" 1, "liga" 1, "pnum" 1, "tnum" 0, "onum" 1, "lnum" 0, "dlig" 1;
    }
    
    abbr {
    text-transform: uppercase;
    font-feature-settings: "kern" 1, "liga" 1, "pnum" 1, "tnum" 0, "onum" 1, "lnum" 0, "smcp" 1, "c2sc" 1;
    }
    
    time {
    font-feature-settings: "kern" 1, "liga" 1, "pnum" 1, "tnum" 0, "onum" 1, "lnum" 0;
    }
    
    pre,
    kbd,
    samp,
    code {
    font-feature-settings: "kern" 0, "liga" 0, "dlig" 0, "pnum" 0, "tnum" 1, "onum" 0, "lnum" 1, "zero" 1;
    }
    
    sup {
    font-feature-settings: "kern" 1, "liga" 1, "pnum" 1, "tnum" 0, "onum" 1, "lnum" 0, "dlig" 0, "sups" 1;
    }
    
    sub {
    font-feature-settings: "kern" 1, "liga" 1, "pnum" 1, "tnum" 0, "onum" 1, "lnum" 0, "dlig" 0, "subs" 1;
    }
    
    table {
    font-feature-settings: "kern" 0, "liga" 1, "pnum" 0, "tnum" 1, "onum" 0, "lnum" 1, "zero" 1;
    }
    
    table thead,
    table tfoot {
    font-feature-settings: "kern" 1, "liga" 1, "pnum" 1, "tnum" 0, "onum" 1, "lnum" 0, "dlig" 0;
    }
    
    input[type="color"],
    input[type="date"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="number"],
    input[type="range"],
    input[type="tel"],
    input[type="week"] {
    font-feature-settings: "kern" 0, "liga" 1, "pnum" 1, "tnum" 0, "onum" 0, "lnum" 1, "zero" 0;
    }
    

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文