发新话题
打印

纯DIV/CSS对联漂浮广告代码(无JS)

纯DIV/CSS对联漂浮广告代码(无JS)

演示效果:www.codepub.com
0 B& d4 [( X, X% E) l$ V: t' j源码网两侧漂浮。经测试,兼容IE6,IE7,Firefox浏览器。
5 w" r3 e& e/ P! ?; k3 E1 O' V
9 K; \& Q: T5 z1 L- dCSS代码为:7 F5 G4 h9 [* V5 F2 A/ d6 ?; V
.r1{width:80px;height:80px;background:red;float:right;   8 n  j( B! n2 O7 d/ @, I
     position:fixed !important; top/**/:200px;   - w. U* U  d$ C" v; Q
     position:absolute; z-index:300; top:expression(offsetParent.scrollTop+200);right:20px;}
/ ~0 T* c2 h) k.r2{width:80px;height:80px;background:red;float:right;   0 S# e; M$ v; j- E* V. d- _: B
     position:fixed !important; top/**/:300px;   
  Z0 P8 u; w/ L& U# ~0 i5 V     position:absolute; z-index:400; top:expression(offsetParent.scrollTop+300);right:20px;}4 M" G3 p% j- a8 V2 `  L4 W- N
.l1{width:80px;height:80px;background:red;float:right;   0 k+ n! V$ r/ O( u7 f
     position:fixed !important; top/**/:200px;   
% x$ e; @1 T) w/ p- Y( q     position:absolute; z-index:300; top:expression(offsetParent.scrollTop+200);left:20px;}
: S  X1 o6 o  E& @6 P, v+ q.l2{width:80px;height:80px;background:red;float:right;   
- I% d! G1 V$ \: i, Y5 y     position:fixed !important; top/**/:300px;   
/ u/ \! O; ]+ ?# U, x     position:absolute; z-index:400; top:expression(offsetParent.scrollTop+300);left:20px;}
. W4 h5 W1 F; \' h" V: f- C. ^
: E! e6 ?6 n" L$ }7 j' |+ F# o$ x/ H# H- V
页面代码为:
8 j$ M. J* M/ L<div class="r1"><a href="/d/adclick.php?id=11&url=http://www.25idc.com" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>  
" |/ \7 S; m- L3 H<div class="r2"><a href="/d/adclick.php?id=11&url=http://www.25idc.com" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>    H/ \- g$ V4 T% ?, ^' J7 D+ C( P
<div class="l1"><a href="/d/adclick.php?id=11&url=http://www.25idc.com" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>  5 g5 s4 o4 h4 ~0 y4 n) y. P: p  d
<div class="l2"><a href="/d/adclick.php?id=11&url=http://www.25idc.com" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>

TOP

发新话题