Day # 45: Tooltip
Today’s project consists of a trick you often see on certain websites when you hover the titles of a menu. Sometimes you only see an icon but once you hover it, you get to see the title that corresponds to that icon.
I thought of creating, for today’s website, a small navigation bar filled with icons that, once you hover them, you can view the title of said icon.
The key here is to play around with the position of those icons and then with the ones of the titles, so that you can make them show or disappear, depending on the case:
.navigation ul li a .title {
position: absolute;
left: 70px;
display: block;
background: #fff;
width: auto;
padding: 5px 10px;
transform: translateY(-15%) translateX(0px);
border-radius: 6px;
box-shadow: 0 5px 15px rgba(0,0,0,.1);
visibility: hidden;
opacity: 0;
transition: 0.5s;
}
.navigation ul li:hover a .title {
transform: translateY(-15%) translateX(0px);
visibility: visible;
opacity: 1;
}
Comments
Post a Comment