Skip to content

Instantly share code, notes, and snippets.

@AndryWJ
Created February 8, 2018 12:41
Show Gist options
  • Save AndryWJ/9b31fffbef6a27760232d57961977e94 to your computer and use it in GitHub Desktop.
Save AndryWJ/9b31fffbef6a27760232d57961977e94 to your computer and use it in GitHub Desktop.
drop down MNU (justify)
<!-- html -->
<div id="menu">
<ul>
<li><a href="#1"></a><span>Индивидуальный пошив</span></li>
<li><a href="http://css-live.ru/articles-css/ravnomernoe-vyravnivanie-blokov-po-shirine.html"></a><span>Технология</span></li>
<li><a href="#3"></a><span>Ткани</span>
<ul>
<li><a href="#"></a><span>дроп даун</span></li>
<li><a href="#"></a><span>дроп даун</span></li>
<li><a href="#"></a><span>дроп даун</span></li>
<li><a href="#"></a><span>дроп даун</span></li>
</ul>
</li>
<li><a href="#4"></a><span>Цены</span></li>
<li><a href="#5"></a><span>О нас</span></li>
<li><a href="#6"></a><span>Контакты</span></li>
</ul>
</div>
<!-- css -->
/* 1 lvl menu items*/
#menu > ul{
display: table;
padding: 0;
margin: 0;
width: 100%;
table-layout: fixed;
list-style-type: none;
border-collapse: collapse;
}
#menu > ul > li{
display: table-cell;
text-align: center;
vertical-align: middle;
box-sizing: border-box;
}
#menu > ul > li > a{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#menu > ul > li > span{
display: block;
height: 100%;
color: inherit;
padding: 10px 5px;
transition: color .25s ease;
}
/* 2 lvl menu items*/
#menu > ul > li > ul {
position: absolute;
box-sizing: border-box;
list-style-type: none;
width: calc(100% + 2px);
left: -1px;
padding: 0;
visibility: hidden;
opacity: 0;
transition: opacity .25s ease;
bottom: 0;
transform: translateY(100%);
}
#menu > ul > li > ul > li >a{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
}
#menu > ul > li > ul > li > span{
padding: 10px 5px;
display: block;
}
/* hover */
#menu > ul > li:hover > ul{
opacity: 1;
visibility: visible;
}
/* all lvl */
#menu li{
position: relative;
}
#menu > ul > li > ul >li:last-child{
border-bottom: none ;
}
/**** THEME ****/
/* color text all */
#menu > ul > li span{
color: GREEN;
}
/* border: 1 lvl mnu */
#menu > ul > li{
border: 1px solid #000;
}
/* color hover text */
#menu > ul > li:hover >span,
#menu > ul > li > ul > li:hover > span{
color: blue;
}
/* border dropdown wrap */
#menu > ul > li > ul{
border: 1px solid #000;
}
/* items dropdoun menu */
#menu > ul > li > ul >li{
border-bottom: 1px solid #FFFFFF;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment