CSS+DIV做滑动门菜单,和TAB式选项卡菜单,要详细步骤

html-css013

CSS+DIV做滑动门菜单,和TAB式选项卡菜单,要详细步骤,第1张

你用dreamweaver cs4的那里有现成的,直接在编辑器里创建就行了,具体步骤 插入—spry—菜单栏,选项卡式面板,折叠式等,很多,,然后如果你会css+div的话可以把他们放到你想用的位置,找到相应代码修改下你想要的颜色就可以了,另外说一下,在cs4里,你直接按住alt直接可以转到标签(相应css),希望可以对你有所帮助

<style type="text/css">

<!--

*{padding:0margin:0}

img{border:0display:block}

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 {

WIDTH: 302px

}

#NewsTop {

CLEAR: bothMARGIN-BOTTOM: 16px

}

#NewsTop P {

FLOAT: leftLINE-HEIGHT: 21px

}

#NewsTop P.topTit {

FONT-WEIGHT: boldWIDTH: 117px

}

#NewsTop P.topC0 {

BACKGROUND: #dcdcdcBORDER-LEFT: #f2f2f2 1px solidWIDTH: 40pxCURSOR: pointer

}

#NewsTop P.topC1 {

BACKGROUND: #c2130eBORDER-LEFT: #f2f2f2 1px solidWIDTH: 40pxCOLOR: #fff

}

#NewsTop #NewsTop_tit {

BORDER-BOTTOM: #c2130e 3px solidHEIGHT: 21px

}

#NewsTop #NewsTop_cnt {

PADDING-LEFT: 32pxBACKGROUND: url(http://www.popuni.com/attachments/month_0703/o2007320133249.gif) no-repeat 12px 13pxLINE-HEIGHT: 26pxPADDING-TOP: 7pxHEIGHT: 260pxTEXT-ALIGN: left

}

#NewsTop #NewsTop_cnt A {

COLOR: #666TEXT-DECORATION: none

}

#NewsTop #NewsTop_cnt A:hover {

COLOR: #c2130eTEXT-DECORATION: underline

}

-->

</style>

<DIV id="cntR" style="float:leftdisplay:blockclear:both">

<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>

<div align="right"><A href="#" target=_self>...more</A></div>

</SPAN>

<SPAN>

<A href="#" target=_self>美华裔女兵在营房上吊死亡军方介入调查(图)</A><BR>

<div align="right"><A href="#" target=_self>...more</A></div>

</SPAN>

<SPAN>

<A href="#" target=_self>最高法:承诺不判赖昌星死刑没有超越法律程序</A><BR>

<div align="right"><A href="#" target=_self>...more</A></div>

</SPAN>

<SPAN>

<A href="#" target=_self>铁道部回应吴敬琏质疑:春运不涨价将长期坚持</A><BR>

<div align="right"><A href="#" target=_self>...more</A></div>

</SPAN>

</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'

}

</SCRIPT>

</DIV>

</DIV>