Skip to content Skip to sidebar Skip to footer

Showing Tooltip For A Checkbox Inside A Modal

I have a modal and inside that modal I have a checkbox which is acting like a switch button.I want to show a tooltip for that checkbox when I will hover on it.How to do this . Titl

Solution 1:

If you want to display the title as a tooltip, you can do something like this.

input {
  position: relative;
}

input::after {
  content: attr(title);
  display: block;
  
  /* just for demo purposes :) */
  transition: all .3s;
  opacity: 0;
  position: absolute;
  background: tomato;
  color: white;
  padding: 0.5rem 1rem;
  bottom: -3rem;
}

input:hover::after{
  opacity: 1;
}
<div class="bootstrap-switch bootstrap-switch-wrapper bootstrap-switch-on bootstrap-switch-id-chkSyncType bootstrap-switch-animate" style="width: 161.818px;"><div class="bootstrap-switch-container" style="width: 240px; margin-left: 0px;"><span class="bootstrap-switch-handle-on bootstrap-switch-success" style="width: 80px;">&nbsp;Auto&nbsp;</span><span class="bootstrap-switch-label" style="width: 80px;">&nbsp;</span><span class="bootstrap-switch-handle-off bootstrap-switch-default" style="width: 80px;">&nbsp;Manual&nbsp;</span><input id="chkSyncType" title="mytooltip" type="checkbox" class="make-switch" data-on-color="success" data-on-text="&nbsp;Auto&nbsp;" data-off-text="&nbsp;Manual&nbsp;" value="false" checked="checked"></div></div>

Post a Comment for "Showing Tooltip For A Checkbox Inside A Modal"