我在弄一个下拉菜单,现在碰到了一些问题
菜单里面的链接没有浮动,只有关闭 {LINKGROUP}后面的<li>标签才行, 这样就没有了下拉菜单
tpl文件:- <!-- BEGIN: navcategories -->
- <!-- BEGIN: group -->
- <ul id="cssdropdown">
- <li class="mainitems">{LINKGROUP}
- <ul class="subuls"> <!-- BEGIN: li -->
- <a href="{LINKDATA}" class="{FONTSTYLE}">{DATA}</a>
- <!-- BEGIN: openul -->
- {OPENUL}
- <!-- END: openul -->
- <!-- BEGIN: subli -->
- <a href="{SUBLINKDATA}" class="{SUBFONTSTYLE}">{SUBDATA}</a>{COMMA}
- <!-- END: subli -->
- <!-- BEGIN: closeul -->
- {CLOSEUL}
- <!-- END: closeul -->
- <!-- END: li --></ul>
- <!-- END: group -->
- <!-- END: navcategories -->
复制代码 Css文件:- #cssdropdown, #cssdropdown ul {
- padding: 0;
- margin: 0;
- list-style: none;
- }
- #cssdropdown li {
- float: left;
- position: relative;
- }
- .linkGroup:hover {
- background-color:#747474;
- cursor:pointer;
- }
- .mainitems{
- background-color: transparent !important;
- border-bottom-style: solid !important;
- border-bottom-width: 0 !important;
- border-left: 1px solid #A9A9A9 !important;
- border-right: 1px solid #585858 !important;
- border-top-style: solid !important;
- border-top-width: 0 !important;
- }
- .mainitems a{
- margin-left: 6px;
- margin-right: 8px;
- text-decoration: none;
- }
- .subuls{
- display: none;
- position: absolute;
- top: 1.2em;
- left: 0;
- background-color: #fff;
- border: 1px solid black;
- }
- .subuls li{
- width: 100%;
- padding:5px;
- }
- .subuls li a:hover{
- text-decoration: underline;
- color:#913a93;
- }
- #cssdropdown li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the containing li, rather than bottom left */
- top: auto;
- left: auto;
- }
- #cssdropdown li:hover ul, li.over ul { /* lists nested under hovered list items */
- display: block;
- }
复制代码 |