I am making a page there are 3 tabs “seeker”, “Owner” and “Admin”.
(1) If seeker logs in then “Owner” and “Admin” tabs should display tooltip message “You are not authorized for this section/Tab” on hover of “Owner” and “Admin” tabs
(2) and if Owner logs in then “Admin” tab should display tooltip message “You are not authorized for this section/Tab” on hover of “Admin” tab.
Is this possible that we can achieve this using CSS :not() selectors, I tried but no luck, or any other way around to achieve this, kindly suggest.
here is my working:
<div class="row">
<a href="#" class="btn tooltip right">
<span>Seeker</span>
<span class="tooltip-content">Lorem ipsum dolor sit amet</span>
</a>
</div>
<div class="row">
<a href="#" class="btn tooltip right">
<span>Owner</span>
<span class="tooltip-content">You are not authorised for this Section</span>
</a>
</div>
<div class="row">
<a href="#" class="btn tooltip right">
<span>Admin</span>
<span class="tooltip-content">You are not authorised for this Sectiont</span>
</a>
</div>
/* USELESS CSS */
.content {
align-items: center;
box-sizing: border-box;
display: flex;
flex-direction: column;
height: 100vh;
font-family: 'Fira Sans', sans-serif;
justify-content: center;
padding: 2rem 0;
width: 100vw;
}
.row {
display: flex;
margin: auto;
}
a {
text-decoration: none;
}
.btn {
margin: 0 0.5em;
}
/* COLORS */
/* BUTTONS */
.btn {
align-items: center;
background-color: white;
border: 1px solid #cdd2d6;
box-sizing: border-box;
color: #000;
display: flex;
height: 45px;
letter-spacing: 2px;
padding: 0.8em 1em;
transition: all 0.3s ease;
margin-bottom: 20px;
}
.btn:hover {
background-color: #05a8ff;
border-color: #05a8ff;
color: #fff;
}
/* TOOLTIP */
.tooltip {
position: relative;
overflow: hidden;
}
.tooltip:hover {
overflow: visible;
}
.tooltip:hover .tooltip-content {
opacity: 1;
}
.tooltip .tooltip-content {
background: #05a8ff;
box-shadow: 0 5px 25px 5px rgba(205, 210, 214, .8);
box-sizing: border-box;
color: #fff;
font-size: 12px;
line-height: 1.2;
letter-spacing: 1px;
max-width: 200px;
min-width: 145px;
padding: 1em;
position: absolute;
opacity: 0;
transition: all 0.3s ease;
}
.tooltip .tooltip-content::after {
background: #05a8ff;
content: "";
height: 10px;
position: absolute;
transform: rotate(45deg);
width: 10px;
}
.tooltip.right .tooltip-content {
left: calc(100% + 1.5em);
top: 50%;
transform: translateY(-50%);
}
.tooltip.right .tooltip-content::after {
left: -5px;
margin-top: -5px;
top: 50%;
}