<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<div class="container-fluid">
<div class="row">
<ul class="custom-navbar">
<li><a href="#" class="active">Tooltip Bottom</a>
</li>
<li><a href="#home" class="titletip">Home<span class="textBottom">Home</span></a>
</li>
<li><a href="#relatives" class="titletip">Relatives<span class="textBottom">Relatives</span></a>
</li>
<li><a href="#notifications" class="titletip">Notifications<span class="textBottom">Notification</span></a>
</li>
<li><a href="#inbox" class="titletip">Inbox<span class="textBottom">Inbox</span></a>
</li>
<li><a href="#settings" class="titletip">Settings<span class="textBottom">Settings</span></a>
</li>
</ul>
</div>
<hr />
<div class="row">
<ul class="custom-navbar">
<li><a href="#" class="active">Tooltip Top</a>
</li>
<li><a href="#home" class="titletip">Home<span class="textTop">Home</span></a>
</li>
<li><a href="#relatives" class="titletip">Relatives<span class="textTop">Relatives</span></a>
</li>
<li><a href="#notifications" class="titletip">Notifications<span class="textTop">Notification</span></a>
</li>
<li><a href="#inbox" class="titletip">Inbox<span class="textTop">Inbox</span></a>
</li>
<li><a href="#settings" class="titletip">Settings<span class="textTop">Settings</span></a>
</li>
</ul>
</div>
</div>
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
overflow-x: hidden;
scroll-behavior: smooth;
text-align: center;
}
.custom-navbar {
position: -webkit-sticky;
position: sticky;
top: -1px;
width: 100%;
height: auto;
padding: 0px 10px;
z-index: 9;
background-color: #FFF;
}
.custom-navbar li{
text-decoration: none;
list-style: none;
padding: 12px 0px;
display:inline-block;
list-style-type: none;
letter-spacing: 1.2px;
}
.custom-navbar li a{
color: #000;
font-size: 17px;
padding: 14px 50px;
border-radius: 4px 4px;
}
.custom-navbar li a:hover{
color: #404040;
text-decoration: none;
cursor: pointer;
background-color: rgba(0,0,0,0.1111);
-webkit-box-shadow: 0px 0px 5px -1px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 5px -1px rgba(0,0,0,0.75);
box-shadow: 0px 0px 5px -1px rgba(0,0,0,0.75);
}
.custom-navbar li a:focus, .custom-navbar li a.focus, .custom-navbar li a.active, .custom-navbar li a:active{
color: #E4E4E4;
text-decoration: none;
cursor: pointer;
background-color: rgba(0,0,0,0.8);
-webkit-box-shadow: 0px 0px 5px -1px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 5px -1px rgba(0,0,0,0.75);
box-shadow: 0px 0px 5px -1px rgba(0,0,0,0.75);
}
.custom-navbar li img{
width: 30px;
height: 30px;
}
.titletip {
position: relative;
display: inline-block;
}
.titletip .textTop {
visibility: hidden;
min-width: 120px;
max-width: 150px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 5px;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
}
.titletip .textTop::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
.titletip .textBottom {
visibility: hidden;
min-width: 120px;
max-width: 150px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 5px;
position: absolute;
z-index: 1;
top: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
}
.titletip .textBottom::after {
content: " ";
position: absolute;
bottom: 100%; /* At the top of the tooltip */
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent black transparent;
}
.titletip:hover .textTop, .titletip:hover .textBottom {
visibility: visible;
opacity: 0.85;
}