css是层叠样式表。
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。CSS不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。
特点:
CSS可以将样式定义在HTML元素的style属性中,也可以将其定义在HTML文档的header部分,也可以将样式声明在一个专门的CSS文件中,以供HTML页面引用。总之,CSS样式表可以将所有的样式声明统一存放,进行统一管理。
另外,可以将相同样式的元素进行归类,使用同一个样式进行定义,也可以将某个样式应用到所有同名的HTML标签中,也可以将一个CSS样式指定到某个页面元素中。如果要修改样式,我们只需要在样式列表中找到相应的样式声明进行修改。
我给楼主看了一下```你要的效果没说清楚`如果想显示出下拉列表直接删掉 #menu li dd{display:none}
就可以了。如果想鼠标移动后,出现下拉列表,我没看到楼主定义这个类型,所以给楼主一个我以前写的,仅供参考。
.imcm ul,.imcm li,.imcm div,.imcm span,.imcm a{text-align:leftvertical-align:toppadding:0pxmargin:0list-style:none outside noneborder-style:nonebackground-image:noneclear:nonefloat:nonedisplay:blockposition:staticoverflow:visibleline-height:normal}
.imcm li a img{display:inlineborder-width:0px}
.imcm span{display:inline}
.imcm .imclear,.imclear{clear:bothheight:0pxvisibility:hiddenline-height:0pxfont-size:1px}.imcm .imsc{position:relative}.imcm .imsubc{position:absolutevisibility:hidden}.imcm li{list-style:nonefont-size:1pxfloat:left}.imcm ul ul li{width:100float:left !important}
.imcm a{display:blockposition:relative}
.imcm ul .imsc,.imcm ul .imsubc {z-index:10}
.imcm ul ul .imsc,.imcm ul ul .imsubc{z-index:20}
.imcm ul ul ul .imsc,.imcm ul ul ul .imsubc{z-index:30}
.imde ul li:hover .imsubc{visibility:visible}
.imde ul ul li:hover
.imsubc{visibility:visible}
.imde ul ul ul li:hover
.imsubc{visibility:visible}
.imde li:hover ul .imsubc{visibility:hidden}
.imde li:hover ul ul .imsubc{visibility:hidden}
.imde li:hover ul ul ul .imsubc{visibility:hidden}
.imcm .imea{display:blockposition:relativeleft:0pxfont-size:1pxline-height:1pxheight:0pxwidth:1pxfloat:right}
.imcm .imea span{display:blockposition:relativefont-size:1pxline-height:0px}.dvs,.dvm{border-width:0px}/*\*//*/.imcm .imea{visibility:hidden}/**/</style><!--[if IE]><style type="text/css">.imcm .imea span{position:absolute}.imcm .imclear,.imclear{display:none}.imcm{zoom:1} .imcm li{curosr:hand} .imcm ul{zoom:1}.imcm a{zoom:1}</style><![endif]--><!--[if gte IE 7]><style type="text/css">.imcm .imsubc{background-image:url(ie_css_fix)}</style><![endif]--><!--end-->
<!--[imstyles] *** Infinite Menu Styles: Keep this section in the document head for full validation. -->
<style type="text/css">
/* --[[ Main Expand Icons ]]-- */
#imenus0 .imeam span,#imenus0 .imeamj span {background-image:url(bg-daohangS.jpg)width:1pxheight:12pxleft:0pxtop:0pxbackground-repeat:no-repeatbackground-position:top left}
#imenus0 li:hover .imeam span,#imenus0 li a.iactive .imeamj span {background-image:url(bg-daohangS.jpg)background-repeat:no-repeatbackground-position:top left}
/* --[[ Sub Expand Icons ]]-- */
#imenus0 ul .imeas span,#imenus0 ul .imeasj span {background-image:url(stub_arrow_right.gif)width:6pxheight:8pxleft:0pxtop:3pxbackground-repeat:no-repeatbackground-position:top left}
#imenus0 ul li:hover .imeas span,#imenus0 ul li a.iactive .imeasj span {background-image:url(stub_arrow_right.gif)background-repeat:no-repeatbackground-position:top left}
/* --[[ Main Container ]]-- */
#imouter0 {background-color:#95D4CCborder-style:noneborder-color:#CCCCCCborder-width:1pxpadding:0pxmargin:0px}
/* --[[ Sub Container ]]-- */
#imenus0 li ul {background-color:#95d4ccborder-style:solidborder-color:#687a54border-width:1pxpadding:5px 8px 5px 5pxmargin:0px}
/* --[[ Main Items ]]-- */
#imenus0 li a, #imenus0 .imctitle {height:16pxbackground-color:#95D4CCcolor:#000text-align:leftfont-family:Arialfont-size:12pxfont-weight:normaltext-decoration:none padding:3px 6px 1pxmargin:0px 5px 0px 0px}
/* [hover] - These settings must be duplicated for IE compatibility.*/
#imenus0 li:hover>a {background-color:#5B9890text-decoration:none}
#imenus0 li a.ihover, .imde imenus0 a:hover {background-color:#95d4cctext-decoration:none}
/* [active] */
#imenus0 li a.iactive {}
/* --[[ Sub Items ]]-- */
#imenus0 ul a, #imenus0 .imsubc li .imctitle {height:autobackground-color:transparentcolor:#000text-align:leftfont-size:11pxfont-weight:normaltext-decoration:noneborder-style:solidborder-color:#95d4ccborder-width:1px 0pxpadding:2px 5pxmargin:0px}
/* [hover] - These settings must be duplicated for IE comptatibility.*/
#imenus0 ul li:hover>a {background-color:#5B9890text-decoration:noneborder-color:#687a54}
#imenus0 ul li a.ihover {background-color:#5B9890text-decoration:noneborder-color:#687a54}
/* [active] */
#imenus0 ul li a.iactive {}