3 - 타이어 드롭 다운 메뉴를 만들려고합니다. 상위 메뉴의 왼쪽에 세 번째 수준의 하위 메뉴를 배치하려고하지만 최상위 위치가 제대로 정렬되지 않습니다.왼쪽 아래로 놓기 위치 지정
아래 화면은 내가 얻은 결과입니다.
CSS 코드 :
/* the menu_new_new is the list, you don't need a wrapping div */
#menu_new{
Text-Align: Left;
/*width:100%;*/
background:#194eb1;
/* height:30px;*/
}
/* only mainmenu_new listitems */
#menu_new > li{
display:inline-block;
position:relative;
line-height:35px;
}
/* links in mainmenu_new and both submenu_news */
#menu_new a{
display:block;
text-decoration:none;
padding:0px 10px;
color:#fff;
text-align:Left;
}
/* submenu_news of both levels */
#menu_new li ul{
position: absolute;
top: 35px;
left:0;
min-width:150px;
background: #194eb1;
Text-Align: Left;
}
/* submenu text */
#menu_new li ul li{
Text-Align: Left;
line-height:20px;
List-style-type:none;
border: 1px solid white;
}
/* move the second level submenu_new to the right to don't overlap the parent submenu_new */
#menu_new ul ul{
position: absolute;
top:auto;
left:150px;
Z-index: 10;
}
/* hover effect for submenu_new links */
#menu_new li li a:hover{
background:rgba(255,255,255,0.5);
}
/* hide all submenu_news for default */
#menu_new li ul{
display: none;
}
/* show a submenu_new if the direct parent listitem is hovered */
#menu_new li:hover > ul{
display:block;
}
어떻게 부모 메뉴의 위치로 정상의 위치를 정확히 정렬?
샘플 코드는 http://jsfiddle.net/asovbLqd/?
http://jsfiddle.net/을 사용하여 코드 데모를 만들고 공유 할 수 있습니까? 그게 더 도움이 될거야! – UID
나는 바이올린으로 코드를 만들었습니다. http://jsfiddle.net/asovbLqd/ 여기를 참조하여 도움을 받으십시오. –
내 대답 찾기 및 작동 fiddy 아래 – UID