In an effort to create a custom tooltip balloon, I have decided to override some of the default Bootstrap styles in my project.
Here is the CSS code I am using:
/*overriding bootstrap*/
.tooltip-inner {
border: 1px solid #0ad;
background: #FFFFFF;
font: 12px Arial;
color: #494949;
line-height: 18px;
max-width: 200px;
padding: 12px;
text-align: left;
border-radius: 1px;
box-shadow: 2px 2px 5px rgba(0,0,0,.3);
}
.tooltip-arrow,
.tooltip-arrow:after {
border-width:7px!important;
display: block;
border-color: transparent;
border-style: solid;
height: 0;
position: absolute;
width: 0;
content: "";
}
.tooltip.top>.tooltip-arrow,.tooltip.top>.tooltip-arrow:after {
border-bottom-width:0!important;
border-top-color: #0ad;
bottom: -2px;
margin-left: -7px;
}
.tooltip.top>.tooltip-arrow:after {
border-top-color: #fff;
bottom: 1.5px;
}
.tooltip.right>.tooltip-arrow,.tooltip.right>.tooltip-arrow:after {
border-left-width:0!important;
border-right-color: #0ad;
left: -2px;
margin-top: -7px;
top:22px;
}
.tooltip.right>.tooltip-arrow:after {
border-right-color: #fff;
left: 1.5px;
top:0;
}
.tooltip.left>.tooltip-arrow,.tooltip.left>.tooltip-arrow:after {
border-right-width:0!important;
border-left-color: #0ad;
right: -2px;
margin-top: -7px;
top:22px;
}
.tooltip.left>.tooltip-arrow:after {
border-left-color: #fff;
right: 1.5px;
top:0;
}
.tooltip.bottom>.tooltip-arrow,.tooltip.bottom>.tooltip-arrow:after {
border-top-width:0!important;
border-bottom-color: #0ad;
top: -2px;
margin-left: -7px;
}
.tooltip.bottom>.tooltip-arrow:after {
border-bottom-color: #fff;
top: 1.5px;
}
Here is a preview of my customized tooltip balloon: Click to view
However, I am facing a challenge with aligning the arrows with the (i) symbol inside the tooltip. Due to the varying length of the text content, the height of the balloon changes and the arrows are not centrally aligned. Can anyone provide guidance on how to resolve this issue? Thank you.