css - The Items navigation design -
can me achieve style items of navigation menu while respecting width of each 'li' element
design image
attempt:
.nav_list ul li { text-decoration: none; text-transform: uppercase; font-size: 14px; color: #4d4d4d; border-right: 2px solid #c79c60; padding-right: 15px; margin-right: 15px; display: inline-block; height: 12px; line-height: 11px; border-bottom: 1px solid orange; box-sizing: border-box; }
thanks
you can add triangle on :hover
:before
:pseudo-element , use calc(50% - 5px)
(5px
width
of triangle) position triangle in center.
body { background: url(http://s25.postimg.org/b6q25p4p7/black_thread.png) repeat black; } .nav-container { top: 20px; position: relative; width: 100%; height: 30px; } .nav { width: 100%; height: 30px; maring: 0 auto; text-align: center; } .menu-item { display: inline-block; width: 67px; padding-left: 10px; padding-right: 10px; padding-top: 10px; padding-bottom: 10px; color: #c79c60; position: relative; } .menu-item:hover { cursor: pointer; border-bottom: 2px solid #c79c60; } .menu-item:hover:before { content: ""; position: absolute; width: 0; height: 0; bottom: 0; left: calc(50% - 5px); border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 6px solid #c79c60; }
<body> <div class="nav-container"> <div class="nav"> <div class="menu-item">home</div> <div class="menu-item">about us</div> <div class="menu-item">locations</div> <div class="menu-item">services</div> <div class="menu-item">contact us</div> </div> </div> </body>
Comments
Post a Comment