当前位置:首页 > 建站知识

CSS模仿IE警告信息栏

更新时间:2009.06.22 浏览次数:

把如下代码复制到<body></body>之间

<div id="infobar" align=center><a rel="nofollow" href="index.htm">CSS模仿IE警告信息栏-点击查看此特效源代码</a></div>

把如下代码复制到<head></head>之间

<style type="text/css">
body {
        margin: 0 !important;
        padding: 0 !important;
}

/* A fake IE information bar */
#infobar {
        font: message-box;
}

/* Please adjust the values if the infobar is not looking good */
#infobar a, #infobar a:link, #infobar a:visited, #infobar a:active {
        display: block;
        float: left;
        clear: both;
        width: 100%;
        color: InfoText;
        background: InfoBackground no-repeat fixed .3em .3em;
        padding: .60em .3em .40em 2em;
        border-bottom: .16em outset;
        text-decoration: none;
        cursor: default;
}

#infobar a:hover {
        color: HighlightText;
        background: Highlight no-repeat fixed .3em .3em;
}

/* A fake viewplot for IE information bar */
#viewplot {
        width: 100%;
        height: expression(this.parentNode.offsetHeight - this.offsetTop);
        overflow-x: hidden;
        overflow-y: scroll;
        padding: 1em;   /* Please set this to the value as that of your <body> */
}
</style>