<style type="text/css">
<!--
BODY {
PADDING-RIGHT: 0pxPADDING-LEFT: 0pxFONT-SIZE: 12pxPADDING-BOTTOM: 0pxMARGIN: 0px autoCOLOR: blackLINE-HEIGHT: 150%PADDING-TOP: 10pxBACKGROUND-COLOR: whiteTEXT-ALIGN: center
}
.dis {
DISPLAY: block
}
.undis {
DISPLAY: none
}
#cntR,#cntR2 {
WIDTH: 302px
}
#NewsTop,#NewsTop2 {
CLEAR: bothMARGIN-BOTTOM: 16px
}
#NewsTop P,#NewsTop2 P {
FLOAT: leftLINE-HEIGHT: 21px
}
#NewsTop P.topTit,#NewsTop2 P.topTit {
FONT-WEIGHT: boldWIDTH: 117px
}
#NewsTop P.topC0,#NewsTop2 P.topC0 {
BACKGROUND: #dcdcdcBORDER-LEFT: #f2f2f2 1px solidWIDTH: 40pxCURSOR: pointer
}
#NewsTop P.topC1,#NewsTop2 P.topC1 {
BACKGROUND: #c2130eBORDER-LEFT: #f2f2f2 1px solidWIDTH: 40pxCOLOR: #fff
}
#NewsTop #NewsTop_tit,#NewsTop2 #NewsTop_tit2 {
BORDER-BOTTOM: #c2130e 3px solidHEIGHT: 21px
}
#NewsTop #NewsTop_cnt,#NewsTop2 #NewsTop_cnt2 {
PADDING-LEFT: 32pxBACKGROUND: url(http://www.qpsh.com/icon/1-10.gif) no-repeat 12px 13pxLINE-HEIGHT: 26pxPADDING-TOP: 7pxHEIGHT: 260pxTEXT-ALIGN: left
}
#NewsTop #NewsTop_cnt A,#NewsTop2 #NewsTop_cnt2 A {
COLOR: #666TEXT-DECORATION: none
}
#NewsTop #NewsTop_cnt A:hover,#NewsTop2 #NewsTop_cnt2 A:hover {
COLOR: #c2130eTEXT-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></SPAN>
<SPAN>2 </SPAN>
<SPAN>3</SPAN>
<SPAN>4 </SPAN>
</div>
</DIV>
</DIV>
<!--第二个id不能重复-->
<DIV id=cntR2>
<DIV id=NewsTop2>
<DIV id=NewsTop_tit2>
<P class=topTit>体育栏目</P>
<P class=topC0>国内</P>
<P class=topC0>国际</P>
<P class=topC0>社会</P>
<P class=topC0>网评</P>
</DIV>
<DIV id=NewsTop_cnt2><SPAN title="Don't delete me"></SPAN>
<SPAN><A href="#" target=_self>新疆阜康铁路桥梁坍塌多节运煤车厢侧翻坠河</A><BR></SPAN>
<SPAN>2 </SPAN>
<SPAN>3</SPAN>
<SPAN>4 </SPAN>
</div>
</DIV>
</DIV>
<SCRIPT>
var Tags=document.getElementById('NewsTop_tit').getElementsByTagName('p')
var TagsCnt=document.getElementById('NewsTop_cnt').getElementsByTagName('span')
var len=Tags.length
var flag=1//修改默认值
for(i=1i<leni++){
Tags[i].value = i
Tags[i].onmouseover=function(){changeNav(this.value)}
TagsCnt[i].className='undis'
}
Tags[flag].className='topC1'
TagsCnt[flag].className='dis'
function changeNav(v){
Tags[flag].className='topC0'
TagsCnt[flag].className='undis'
flag=v
Tags[v].className='topC1'
TagsCnt[v].className='dis'
}
/*第二个*/
var Tags2=document.getElementById('NewsTop_tit2').getElementsByTagName('p')
var TagsCnt2=document.getElementById('NewsTop_cnt2').getElementsByTagName('span')
var len=Tags2.length
var flag2=1//修改默认值
for(i=1i<leni++){
Tags2[i].value = i
Tags2[i].onmouseover=function(){changeNav2(this.value)}
TagsCnt2[i].className='undis'
}
Tags2[flag2].className='topC1'
TagsCnt2[flag2].className='dis'
function changeNav2(v){
Tags2[flag2].className='topC0'
TagsCnt2[flag2].className='undis'
flag2=v
Tags2[v].className='topC1'
TagsCnt2[v].className='dis'
}
</SCRIPT>
</BODY></HTML>
没有指定的target属性值时,默认是"_blank,可以参考以下代码的设置来控制\x0d\x0a链接\x0d\x0a \x0d\x0atarget的值\x0d\x0atarget="_blank":在新窗口中浏览新的页面。 \x0d\x0atarget="_self":在同一个窗口打开新的页面。 \x0d\x0atarget="_parent":在父窗口中打开新的页面。(页面中使用框架才有用) \x0d\x0atarget="_top" :以整个浏览器作为窗口显示新页面。(突破了页面框架的限制)?§§ 1020
要想可以横竖切换,你需要使用CSS来实现。 可以在标签的CSS样式中加上“display: flexflex-direction: column” 来使得标签能够横竖切换,更多关于CSS样式可以去进一步了解。