Skip to content

Instantly share code, notes, and snippets.

@AlexKardone
Last active May 6, 2017 15:23
Show Gist options
  • Save AlexKardone/d26af29b6de14d4179041719a12bef13 to your computer and use it in GitHub Desktop.
Save AlexKardone/d26af29b6de14d4179041719a12bef13 to your computer and use it in GitHub Desktop.
Menu on full width of the block
<nav class="menu">
<li><a href="index.html" rel="nofollow">Главная</a></li>
<li><a href="products.html" rel="nofollow">Продукция</a>
<ul>
<li><a href="veniki.html" rel="nofollow">Веники</a></li>
<li><a href="hueniki.html" rel="nofollow">Хуеники</a></li>
</ul>
</li>
<li><a href="about.html" rel="nofollow">О компании</a></li>
<li><a href="license.html" rel="nofollow">Условия использования</a></li>
</nav>
BKWaYz
------
A [Pen](http://codepen.io/gaserge/pen/BKWaYz) by [serge](http://codepen.io/gaserge) on [CodePen](http://codepen.io/).
[License](http://codepen.io/gaserge/pen/BKWaYz/license).
.menu {
position: relative; display: table;
width: 100%; height: 50px;
}
.menu li {
display: table-cell; position: relative; border: 2px solid blue;
}
.menu li a {
display: block; position: relative;
width: 100%; height: 100%;
text-align:center;
line-height: 50px; /* для того чтобы отцентрировать текст по вертикали */
}
.menu li ul {
display: none; position: absolute;
width: 100%;
margin: 0px; padding: 0px;
}
.menu li ul li { display: block; }
.menu li:hover ul { display: block; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment