• 以前写过一篇《关于CSS样式的优先级问题》,当时由于对浏览器的兼容性问题没有太多的了解,所用到的例子也没有提到与浏览器相关的内容,在此做一下补充:

    在此要特别提到!important声明,下面还是用以前的那个例子:

    -----------------------------------------
    <style type="text/css">
    <!--
    #aaa{
       background-color: Fuchsia;
    }
    .aaa{
       background-color: Black;
    }
    td{
       background-color: Aqua !important;
    }
    -->
    </style>
    <table>
    <tr>
    <td class="aaa" id="aaa" style="height:200px;width:200px;background-color: Blue;"></td>
    </tr>
    </table>
    ------------------------------------------

    td将会显示为Aqua,这在IE4+的浏览器与支持!important声明的都是正确的,但如果换成这下这样:

    -----------------------------------------
    <style type="text/css">
    <!--
    #aaa{
       background-color: Fuchsia;
    }
    .aaa{
       background-color: Black;
    }
    td{
       background-color: Aqua !important;
       background-color: Green;
    }
    -->
    </style>
    <table>
    <tr>
    <td class="aaa" id="aaa" style="height:200px;width:200px;background-color: Blue;"></td>
    </tr>
    </table>
    ------------------------------------------

    这个例子的结果是在IE4+的浏览器中td的颜色为Blue,而在FF中的颜色为Aqua 。这说明了在IE4+浏览器中的!important声明并不是“真正的提高优先级”,或说是“不完全的声明”,在声明之后如果有新的、相同属性名的定义,!important声明将会失效。而在FF中,!important声明在同个样式类中的优先级始终是最高的。

    因此,当要修正IE与FF中的差异时,就可以使用第二个例子中的做法,大多数是用于修正定位的问题。

  • 机遇??

    2006-03-07

    有人说:“机遇总是在不知不觉中来到你面前,只有时刻的准备着,才能在机遇离开之前抓住它。”

    今天中午一个自称是“腾讯公司互联网业务系统网站制作主管”的人联系我,说要跟我见下面,这是真的吗?(?-?)我真的不敢相信,为什么会找上我?一时间很多的疑问、兴奋、担心……真可以说是百感交集。这如果是真的,那就是一个很大的机遇了,可以让我的技术在短时间内提升的机会,可以更快的接近我的所谓“理想”……

  • 也是一个用JS写的网站,可以自定义栏目,可以拖动、编辑等等,一个字“强”Good

    netvibes

    www.netvibes.com

  • 一个把DOS界面的程序移植到Web的网站,感觉很爽。

    JS/UIX is an UN*X-like OS for standard web-browsers, written
    entirely in JavaScript (no plug-ins used). It comprises a vir-
    tual machine, shell, virtual file-system, process-management,
    and brings its own terminal with screen- and keyboard-mapping.

    For an overview of implemented commands have a look at the
    complete > JS/UIX-Manual-Pages; see also the > Version-History.

    The keyboard accepts the US-ASCII character set.
    As key-mapping depends from your browser, you may have to use
    the cursor and backspace buttons at the lower right of the
    terminal. A complete keyboard can be accessed at the lower left.

    Compatibility: Netscape 4+, MS IE 4+ and DOM-aware browsers.


    JS/UIX is not a free software. For a free to use terminal-
    interfaces have a look at mass:werk termlib.js.


    © 2003 mass:werk, N.Landsteiner

    jsuix

    www.jsuix.com

  • 珍珠项链

    2006-03-04

    珍珠项链

    珍珠项链