html - Display label (span) no mouse hover -


i creating bar icons content on side:
http://plnkr.co/edit/g6boxcskihewdwp7zrrw?p=preview

when mouse on icon want name appear in front of icon , on content. showing under icon.

how can fix this?

markup

<div class="wrapper">   <div class="navigation">     <ul>       <li>         <a href="#">           <i class="fa fa-home"></i>           <span>one</span>         </a>       </li>       <li>         <a href="#">           <i class="fa fa-book"></i>           <span>two</span>         </a>       </li>     </ul>   </div>   <div class="content">     content</br>     span of icon should on content when mouse on   </div>         </div> 

css

.wrapper {   border: 1px solid red;   padding: 0;   margin: 0;   overflow: hidden; } .navigation {   float: left;   width: 40px; }   .content {   float: left;   width: 200px; } ul {    list-style: none;   padding: 0;   margin: 0; } {   background-color: #d0d0d0;   color: black;   display: inline-block;   padding: 12px;   text-decoration: none; } a:hover {   background-color: black;   color: white; } a:hover span {   display: inline-block; } span {   display: none; } 

here solution:

add width:100% a:hover

a:hover {   background-color: black;   color: white;   width: 100%; } 

and add width:0 & vertical-align:top(optional) a:hover span

a:hover span {   display: inline-block;   vertical-align: top;   width: 0; } 

demo


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -