草根站长论坛's Archiver

紫风铃 发表于 2008-5-26 01:15

CSS模仿IE警告信息栏,效果逼真!

CSS代码:0X)r5O#\ T4la2KJo
[font=NSimsun][code] $`;Z3wp+s@fw
body {+K'Xsb"r"^ f2\F^
        margin: 0 !important;
NwX Z1R0F DT6j         padding: 0 !important;
_?6ns OMn0jz.d }t+a6punKk

qD9u[1E /* A fake IE information bar */4?;r r4\{(g
#infobar {Qz*`My,Il*K'c4G
        font: message-box;3w'h@8^y's"B;{
}`e0s&~L-_0]/mzX:Z8g

T:O5bKF+J{9C /* Please adjust the values if the infobar is not looking good */7B.LO2i}(RKGa
#infobar a, #infobar a:link, #infobar a:visited, #infobar a:active {
R]S&`3p|``a]         display: block;
v'C e^5q'P[t         float: left;
KA(mG7B h         clear: both;2H~ OE/T\+U
        width: 100%;
!A3DQ%?R)g         color: InfoText;
*aV8I;y+Z8oh         background: InfoBackground url(warning.gif) no-repeat fixed .3em .3em;
/VY*h1|o         padding: .45em .3em .45em 2em;,TVvw(E4[
        border-bottom: .16em outset;a]7Zcf
        text-decoration: none;
LtC:^ q2iW7P         cursor: default; D]n,D ~U*go
}
n M {I,| M l
IP!w)b+b#@+? #infobar a:hover {@)ulh*Z_/N
        color: HighlightText;3t(uX_9R+j?
        background: Highlight url(warning2.gif) no-repeat fixed .3em .3em;
$oE*].St }
;U0|'Y(A*x(}1T8`dp !JD8NwG h
/* A fake viewplot for IE information bar */+z_o$R!d)L.P-|z
#viewplot {
|p3G$Ab!s @         width: 100%;
s/L+YKuO@JR9bT         height: expression(this.parentNode.offsetHeight - this.offsetTop);
g5AA5W&h;b+|#t3b         overflow-x: hidden;
7u `k XxH         overflow-y: scroll;
+}g^ZN yD         padding: 1em;   /* Please set this to the value as that of your <body> */6w ^O-VDLl
}l+`HcaE)i*U]
[/code]},`/SU2b p7v*{.}
Discuz!添加代码的方法, 修改模板文件header.htm
"GV2i'u#K%Pkx(\u [/font][font=NSimsun][code] 1@s @:wb^
<!--{if $discuz_uid}-->
$@XB'QRFfO (这里是登陆后显示的内容)/qP Fs2p
<!--{else}-->
|5h,E$AN4l <link rel="stylesheet" href="infobar.css" type="text/css" />4_d$l7l'tDZ/`6u
(这里是未登陆显示的内容)Xy [.`!X
<div id="infobar" align=center><a rel="nofollow" href="/register.php">你尚未登陆请登陆论坛,如果你不是注册用户请点这里注册!</a><embed src="infobar.wav" autostart="true" loop="0" hidden="true"></embed></div>
%el'd#G&?]TK
q+TR_){ UZSFb <!--{/if}-->
"g&k j!E:YcY5h F sH [/code][/font]

阿花 发表于 2008-5-26 13:09

不错不错
-v#J$o D,H!C0F 呵呵

yangdi 发表于 2008-6-2 15:58

呵,弄个图,让我先瞅一眼成不。
%v}P!g)L%v2gO%Ir
[}K"kP:@5f4r'f :11:

zhhouy 发表于 2008-6-3 16:13

来试试效果,谢谢楼主

bainiozhiwei 发表于 2008-6-5 10:28

偶很懒,下次加个代码运行给我们先看看嘛

0733 发表于 2008-6-5 14:58

不错不错
#bw&F2h8^GjT :13:

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.