时间:2021-07-01 10:21:17 帮助过:28人阅读
http-equiv="Content-Type" content="text/html; charset=utf-8">
纯 CSS 多级菜单
.menu{}
.menu ul,.menu li{margin:0; padding:0;list-style:none outside;}
.menu>ul{overflow:auto; display:inline-block;}
.menu a,.menu span{ cursor:default; height:30px; line-height:30px; padding:0 5px; display:block; text-overflow:ellipsis; overflow:hidden; text-decoration:none; color:MenuText;}
.menu a:hover,.menu span:hover,.menu li:hover>a,.menu li:hover>span{color:HighlightText;}
.menu li:hover{background-color:Highlight;}
.menu li:hover>ul{display:block;}
.menu>ul>li{float:left;}
.menu>ul>li ul{display:none;float:left; background-color:#fff; border:1px solid Highlight; position:absolute;}
.menu>ul>li li{padding-left:25px;margin:2px;background:transparent url(data:image/gif;base64,R0lGODlhEAAQAIAAAJmZmf///yH5BAAAAAAALAAAAAAQABAAAAIjhI9pwe2+nmRRIQrmjBrmYB1Y93Ak+IXVd6LtiIZwa5JqWAAAOw==) no-repeat 5px center; width:150px;}
.menu>ul>li>ul>li ul{margin-left:140px; margin-top:-30px;}
.menu li.expand>a,.menu li.expand>span{background:transparent url(data:image/png;base64,R0lGODlhAwAQAIABAAAAAP///yH5BAEAAAEALAAAAAADABAAAAIKjI8JBtv/wko0FQA7) no-repeat right center; padding-right:10px; margin-right:5px;}
.menu>ul>li.expand>a,.menu>ul>li.expand>span{ background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAADCAYAAACwAX77AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY2BgYPiPAwOFMSXBgjAA0wnmAwASVQv19UVKmwAAAABJRU5ErkJggg==);}
id="mainnav" class="menu">
href="#">Link
href="#">Link
class="expand"> href="#">Link
href="#">Link
href="#">Link
class="expand"> href="#">很长很长很长很长很长很长很长很长很长很长
href="#">Link
href="#">Link
class="expand"> href="#">LinkLink
class="expand"> href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
class="expand">span 菜单项
span 菜单项
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
href="#">Link
既然你这么问了,我就当你是新手了,还好,我也是新手。
lang="en">
charset="UTF-8">
下拉菜单
class="at">
class="ct" >
class="dt1">下拉菜单
class="dt">下拉菜单
class="dt">下拉菜单
class="dt">下拉菜单
charset="utf-8">
css实现下拉菜单
id="nav">
href="#">按钮1
href="#">按钮2
href="#">下拉菜单项
href="#">下拉菜单项
href="#">按钮3
href="#">下拉菜单项
href="#">下拉菜单项
href="#">下拉菜单项
href="#">按钮4
href="#">按钮5
这个是网易云课堂前端微专业的页面布局的期末测试题。
我也试一下。
href="#">Menu
class="drop-down" id="drop-down">
Option 1
Option 2
Option 3
Option 4
更正一点小错误,只有一个单选按钮时,选中后就不能取消选中了。所以最好用复选按钮。点击我出现下拉菜单
type="checkbok">
XXX
XXX
XXX
XXX
用列表,隐藏,然后hover.的时候block就可以了
http://pepsized.com/css-only-alternative-to-the-select-element/