如何使用CSS网页源码?

html-css016

如何使用CSS网页源码?,第1张

首先,把css,js和图片放到你的项目文件夹对应位置上,然后把html中的代码复制到你的html文件中,在你的html文件中引入对应的css js文件,注意路径是否正确。然后根据你自己的需要,修改对应的css样式

IE9浏览器默认情况下隐藏了浏览器菜单栏,因此在打开IE9浏览器以后,需要按键盘上的ALT键来显示浏览器工具栏。

2

在显示出来的IE菜单栏上点击菜单“查看”→“源文件”。

3

IE浏览器会自动打开一个新的窗口来显示网页源代码。

4

哦~这份缘文件实在太难看懂了~别着急,其实IE9提供了一个更为强大的网页源代码查看工具——开发者工具。

点击IE9浏览器右上角的齿轮图标,在下拉菜单中点击“F12开发者工具”,或者直接按键盘上的快捷键F12也可以打开开发者工具。

5

IE9的开发者工具提供更为强大的网页开发查看代码和调试功能,你可以使用开发者工具更方便地查看网页HTML代码,CSS样式代码和脚本等信息。

END

使用Firefox火狐浏览器查看网页源代码

1

Windows Vista/7用户:点击Firefox浏览器左上角的快捷菜单,在下拉菜单中点击“Web开发者”→“查看页面源代码”。

Windows XP/Linux用户:点击Firefox浏览器的菜单“工具”→“Web开发者”→“查看页面源代码”。

键盘快捷键:Ctrl+U

2

Firfox浏览器会打开网页源代码窗口显示网页HTML源代码。

3

如果想要查看其中外联的CSS源文件,可以用鼠标点击源代码中的CSS外联文件链接网址。

4

不过自带的之中网页源文件查看器并不好用,你可以尝试使用插件Firebug来获取更好用的网页开发功能。

点击“Web开发者”→“获取更多工具”。

5

在弹出的Firefox新标签页中安装插件“Firebug”。

6

安装完成以后会在Firefox浏览器的右上角工具栏中添加Firebug的图标,点击它就可以使用Firebug网页调试工具了。

这个工具相当强大哦~

END

使用谷歌Chrome浏览器查看网页源代码

点击Chrome浏览器右上角的快捷菜单“工具”→“查看源代码”。

Chrome浏览器会打开一个网页源代码显示窗口,这个源代码显示窗口好像也是不那么友好,一大堆网页代码实在不知道如何下手呀。

如果你想要更好的网页源代码显示和开发工具,那就点击Chrome浏览器右上角的快捷菜单“工具”→“开发者工具”。

看看,不需要下载任何插件,Chrome浏览器就已经为你提供了一个相当强大的网页开发者工具了。

使用Chrome浏览器开发者工具来查看和调试CSS也相当好用。

这个是js实现的,兄弟;

把下面这个js保存到一个单独的js文件内,然后在你页面引用就可以了;

!function () {

    function n(n, e, t) {

        return n.getAttribute(e) || t

    }

    function e(n) {

        return document.getElementsByTagName(n)

    }

    function t() {

        var t = e("script"),

            o = t.length,

            i = t[o - 1]

        a

        return {

            l: o,

            z: n(i, "zIndex", -1),

            o: n(i, "opacity", .5),

            c: n(i, "color", "0,0,0"),

            n: n(i, "count", 99)

        }

    }

    function o() {

        a = m.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,

            c = m.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight

    }

    function i() {

        r.clearRect(0, 0, a, c)

        var n, e, t, o, m, l

        s.forEach(function (i, x) {

            for (i.x += i.xa, i.y += i.ya, i.xa *= i.x > a || i.x < 0 ? -1 : 1, i.ya *= i.y > c || i.y < 0 ? -1 : 1, r.fillRect(i.x - .5, i.y - .5, 1, 1), e = x + 1 e < u.length e++) n = u[e],

            null !== n.x && null !== n.y && (o = i.x - n.x, m = i.y - n.y, l = o * o + m * m, l < n.max && (n === y && l >= n.max / 2 && (i.x -= .03 * o, i.y -= .03 * m), t = (n.max - l) / n.max, r.beginPath(), r.lineWidth = t / 2, r.strokeStyle = "rgba(" + d.c + "," + (t + .2) + ")", r.moveTo(i.x, i.y), r.lineTo(n.x, n.y), r.stroke()))

        }),

            x(i)

    }

    var a, c, u, m = document.createElement("canvas"),

        d = t(),

        l = "c_n" + d.l,

        r = m.getContext("2d"),

        x = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||

            function (n) {

                window.setTimeout(n, 1e3 / 45)

            },

        w = Math.random,

        y = {

            x: null,

            y: null,

            max: 2e4

        }

    m.id = l,

        m.style.cssText = "position:fixedtop:0left:0z-index:" + d.z + "opacity:" + d.o,

        e("body")[0].appendChild(m),

        o(),

        window.onresize = o,

        window.onmousemove = function (n) {

            n = n || window.event,

                y.x = n.clientX,

                y.y = n.clientY

        },

        window.onmouseout = function () {

            y.x = null,

                y.y = null

        }

    for (var s = [], f = 0 d.n > f f++) {

        var h = w() * a,

            g = w() * c,

            v = 2 * w() - 1,

            p = 2 * w() - 1

        s.push({

            x: h,

            y: g,

            xa: v,

            ya: p,

            max: 6e3

        })

    }

    u = s.concat([y]),

        setTimeout(function () {

                i()

            },

            100)

}()