CSS+Javascript實現新聞滑動文本選項卡顯示,在網頁中應用選項卡可以使網頁顯得更緊湊,結合AJAX技術可以使頁面在有限的空間內展現更多的內容:
以下是引用片段:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML><HEAD><TITLE>絕對經典的滑輪新聞顯示(javascript+css)</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style type="text/css">
<!--
*{padding:0; margin:0}
img{border:0; display:block;}
BODY {
PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; MARGIN: 0px auto; COLOR: black; LINE-HEIGHT: 150%; PADDING-TOP: 10px; BACKGROUND-COLOR: white; TEXT-ALIGN: center
}
.dis {
DISPLAY: block
}
.undis {
DISPLAY: none
}
#cntR,#cntR2{
WIDTH: 302px
}
#NewsTop,#NewsTop2{
CLEAR: both; MARGIN-BOTTOM: 16px
}
#NewsTop P,#NewsTop2 P {
FLOAT: left; LINE-HEIGHT: 21px
}
#NewsTop P.topTit,#NewsTop2 P.topTit{
FONT-WEIGHT: bold; WIDTH: 117px
}
#NewsTop P.topC0,#NewsTop2 P.topC0 {
BACKGROUND: #dcdcdc; BORDER-LEFT: #f2f2f2 1px solid; WIDTH: 40px; CURSOR: pointer
}
#NewsTop P.topC1,#NewsTop2 P.topC1 {
BACKGROUND: #c2130e; BORDER-LEFT: #f2f2f2 1px solid; WIDTH: 40px; COLOR: #fff
}
#NewsTop #NewsTop_tit,#NewsTop2 #NewsTop_tit2 {
BORDER-BOTTOM: #c2130e 3px solid; HEIGHT: 21px
}
#NewsTop #NewsTop_cnt,#NewsTop2 #NewsTop_cnt2 {
PADDING-LEFT: 32px; BACKGROUND: url(o2007320133249.gif) no-repeat 12px 13px; LINE-HEIGHT: 26px; PADDING-TOP: 7px; HEIGHT: 260px; TEXT-ALIGN: left
}
#NewsTop #NewsTop_cnt A,#NewsTop2 #NewsTop_cnt2 A {
COLOR: #666; TEXT-DECORATION: none
}
#NewsTop #NewsTop_cnt A:hover,#NewsTop2 #NewsTop_cnt2 A:hover {
COLOR: #c2130e; TEXT-DECORATION: underline
}
-->
</style>
</HEAD>
<BODY>
<DIV id="cntR">
<DIV id="NewsTop">
<DIV id="NewsTop_tit">
<P class="topTit">新聞排行</P>
<P class="topC0">國內</P>
<P class="topC0">國際</P>
<P class="topC0">社會</P>
<P class="topC0">網評</P>
</DIV>
<DIV id="NewsTop_cnt">
<SPAN title="Don't delete me"></SPAN>
<SPAN>
<A href="#" target=_self>新疆阜康鐵路橋梁坍塌多節運煤車廂側翻墜河</A><BR>
<A href="#" target=_self>最高法:承諾不判賴昌星死刑沒有超越法律程序</A><BR>
<A href="#" target=_self>物權法:滿70年住宅建設用地使用權將自動續期</A><BR>
<A href="#" target=_self>弟弟被妻下藥毒死男子買女屍為其配陰婚(圖)</A><BR>
<A href="#" target=_self>揭開鄭州神槍手神秘面紗 頭號狙擊手是近視眼</A><BR>
<A href="#" target=_self>美軍高官:不排除和中國發生直接軍事對抗可能</A><BR>
<A href="#" target=_self>浙江東陽傳奇富姐吳英涉嫌非法吸收存款被批捕</A><BR>
<A href="#" target=_self>西方炒作"中國航母威脅論"稱05年已正式服役</A>&