HTML 开发中必然会用到的技术

HTML 开发中必然会用到的技术

HTML5 ★ BOILERPLATE

HomepageGitHub

HTML5 Boilerplate helps you build fastrobust, and adaptable web apps or sites. Kick-start your project with the combined knowledge and effort of 100s of developers, all in one little package.

https://html5boilerplate.com/

Normalize.css

HomepageGitHub

Normalize.css makes browsers render all elements more consistently and in line with modern standards. It precisely targets only the styles that need normalizing.

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

网页自适应

这段代码来自于淘宝触屏版,主要是为了解决 H5 页面自适应不同大小手机屏幕的问题,区别于“响应式网页”

! function (g, f) {
    var k = f.documentElement,
        j = g.devicePixelRatio || 1;

    function c() {
        var a = k.clientWidth / 3.75;
        k.style.fontSize = a + "px"
    }
    if (function g() {
        f.body ? f.body.style.fontSize = "16px" : f.addEventListener("DOMContentLoaded", g)
    }(), c(), g.addEventListener("resize", c), g.addEventListener("pageshow", function (a) {
        a.persisted && c()
    }), 2 <= j) {
        var h = f.createElement("body"),
            b = f.createElement("div");
        b.style.border = ".5px solid transparent", h.appendChild(b), k.appendChild(h), 1 === b.offsetHeight && k.classList.add("hairlines"), k.removeChild(h)
    }
}(window, document);

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注