css - Marker on top of the menu list items -


how can create marker appears on top of menu list items when hover on them ?like 1 have here . it's possible create css ?

edit:i don't want code , want tips because don't know start.

here minimal example of want achieve. important parts :before pseudo element , position: relative of <a>. please notice width of "markers" width property of pseudo element. (in case it's 2px). here css-part of marker pseudo element.

a:hover:before {     content:"";     width: 2px;     height: 20px;     background: #000;     position: absolute; /* works when parent 'position:relative' */     left: 50%;     top: -10px; } 

minimal example snippet

html * {    box-sizing: border-box;  }  ul {    list-style: none;  }  ul > li {    display: inline-block;  }  li > {    padding: 5px 10px;    position: relative;  }  a:hover:before {    content: "";    width: 2px;    height: 20px;    background: #000;    position: absolute;    left: 50%;    top: -10px;  }
<ul>    <li><a href="#">item 1</a>    </li>    <li><a href="#">item 2</a>    </li>    <li><a href="#">item 3</a>    </li>    <li><a href="#">item 4</a>    </li>    <li><a href="#">item 5</a>    </li>  </ul>


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -