Using bootstrap 4.5.3, I have created a tooltip and now I want to customize its appearance by adding my own styles:
.tooltip {
display: flex;
justify-content: flex-start;
position: absolute;
z-index: 9999;
background: #ddff9d;
color: #333333;
width: 320px;
-webkit-box-shadow: 5px 5px 5px 5px white;
box-shadow: 2px 2px 2px 2px white;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-border-radius: 8px;
opacity: 1 !important;
padding: 10px;
text-align: left;
}
.tooltip-inner {
background-color: #00acd6 !important;
/*!important is not necessary if you place custom.css at the end of your css calls. For the purpose of this demo, it seems to be required in SO snippet*/
color: #fff;
}
.tooltip.top .tooltip-arrow {
border-top-color: #00acd6;
}
.tooltip.right .tooltip-arrow {
border-right-color: #00acd6;
}
.tooltip.bottom .tooltip-arrow {
border-bottom-color: #00acd6;
}
.tooltip.left .tooltip-arrow {
border-left-color: #00acd6;
}
Currently, the tooltip looks like this:
But I want to achieve the following modifications:
- Change the width of the internal (blue) block to fill the width + paddings
- Set equal paddings for the internal block as well as the external block
- Align the text inside the internal block to the left
UPDATED BLOCK: This is actually a fullcalendar 3.9 component and the tooltip is rendered dynamically with JavaScript code:
eventRender: function (eventInfo, element, view) {
let adHtml = '<b>' + eventInfo.title + "</b><br> " +
'<u>{!! showAppIcon('expire_date') !!} Expired at : ' + eventInfo.start_formatted + '</u><br>'+
'{!! showAppIcon('location') !!} ' + eventInfo.adLocationsCount + ' location(s)<br>' +
'<small>Status : ' + eventInfo.status_label + "</small><br>" +
'<small>' + eventInfo.description + "</small>"
let tooltipOptions = {
title: adHtml,
html: true
}
element.tooltip(tooltipOptions)
I am using the solar theme from bootswatch template. I am facing issues debugging elements in the browser's inspector as the tooltip gets hidden when the mouse hovers over it...
Thank you!