꽤 괜찮은 메뉴라고 생각되는 훌륭한 튜토리얼을 발견했습니다. 비슷한 세로 형 드롭 다운으로 바꾸려고합니다. http://nettuts.s3.amazonaws.com/699_nav/navCode/nav.html 또는 http://net.tutsplus.com/tutorials/html-css-techniques/how-to-build-a-kick-butt-css3-mega-drop-down-menu/?search_index=3CSS3 탐색 메뉴 변형
단지 목록이 옆에서 오는 것이 아니라 아래로 내려 오도록하고 싶습니다. 나는 그것을 해결할 것이라고 생각한 것을 시도했고 인라인을 표시하는 li 요소를 목표로 삼았지만, 나는 그것을 변화시킬 수 없다. 내가 변경 한 것이 효과가 없거나 뒤죽박죽이되는 원인이된다.
CSS
#thisNav{
width: 250px;
margin: 20px;
background:#bada55;
}
#thisNav ul{
list-style: none;
margin: 0;
padding: 0;
}
#thisNav ul li{
/*child elements positioned absolutley will be relative to this*/
position: relative;
border-top: 1px solid #e9e9e9;
}
#thisNav a{
color: ghostwhite;
padding: 12px 0px;
/*fill hori space*/
display: block;
text-decoration: none;
/*apply transition to background property, taking 1s to change it
*/
transition:padding 1s, background 1s;
-moz-transition:padding 1s, background 1s;
-webkit-transition:padding 1s, background 1s;
-o-transition:padding 1s, background 1s;
font-family:tahoma;
font-size:13px;
text-transform:uppercase;
padding-left:20px;
}
/*hover pseduo class*/
#thisNav a:hover{
/*
RGBA background for transparancy:
last number(0.05) is the transparency
*/
padding-left:35px;
background: RGBA(255,255,255,0.05);
color:#fff;
}
#thisNav ul li:hover ul{
/*diplay when hovered*/
display: block;
}
#thisNav ul ul{
position: absolute;
left: 250px;
top: 0;
border-top: 1px solid #e9e9e9;
display: none;
width: 304px;
}
#thisNav ul ul li{
width: 150px;
background: #f1f1f1;
border: 1px solid #e9e9e9;
border-top: 0;
float:left;
}
#thisNav ul ul li a{
color:#000000;
font-size:12px;
text-transform:none;
}
#thisNav ul ul li a:hover {
color:#929292;
}
#thisNav span {
width:12px;
height:12px;
background:#fff;
display:inline-block;
float:left;
margin-top:3px;
margin-right:10px;
position:relative;
transition:all 0.5s;
-moz-transition:all 0.5s;
-o-transition:all 0.5s;
-webkit-transition:all 0.5s;
}
#thisNav a:hover span {
background: #7d2c41;
transform:rotate(90deg);
-moz-transform:rotate(90deg);
-webkit-transform:rotate(90deg);
}
/*Horizontal line*/
#thisNav span:before {
content:"";
width:12px;
height:2px;
background:#3a3b3b;
position:absolute;
left:0px;
top:5px;
}
/*Vertical line*/
#thisNav span:after {
content:"";
width:2px;
height:12px;
background:#3a3b3b;
position:absolute;
left:5px;
position:top;
}
HTML
<nav id = "thisNav">
<ul>
<li>
<a href="#"><span></span>one</a>
<ul>
<li><a href="#">sub1</a></li>
<li><a href="#">sub2</a></li>
<li><a href="#">sub3</a></li>
</ul>
</li>
<li>
<a href="#"><span></span>two</a>
<ul>
<li><a href="#">sub1</a></li>
<li><a href="#">sub2</a></li>
<li><a href="#">sub3</a></li>
</ul>
</li>
</ul>
</nav>
그것은 훌륭합니다! :) 주요 쟁점은 무엇입니까? 나는 당신이 인라인 etc.에 전시를 바꾸지 않았다는 것을주의한다? – user2608855
당신이 좋아하는 것을 기쁘게 생각합니다! 추가 된 설명을 참조하십시오. –
다시 한번 감사 드리며, 많은 도움이됩니다! :) 나는 지금 작은 사소한 문제가있다. 고칠 수 있는지 확실하지 않습니다. 예를 들어 메인의 너비를 500px로 설정하고 페이지 너비를 100 %로 가정 한 다음 5 가지 항목을 추가하면 내 목록에 꽤 많은 것들이 있습니다. 그들이 페이지를 스크롤/감쌀 때 이상한 일이 일어난다. 해결책을 제안 해 주시겠습니까? 드롭 다운에 추가 레벨을 추가하거나 다른 것을 추가 할 생각입니다. 아마도이 nav는 많은 목록 항목을 위해 설계되지 않았을 것입니다. – user2608855