csstwitter-bootstrap-tooltip

Bootstrap tooltip with long arrow with css or any other alternative


I would to style my field tooltips to appear with long arrow so they don't cover the any subsequent field/icons after or below the control. Something like the image below.

How can I style bootstrap tooltips with a long arrow like in the image. Any CSS based cross browser compatible solution would be perfect.

enter image description here


Solution

  • You really need to post more code/details before expecting people here to just help do it for you.

    Here's a simple demo:

    $('.btn').tooltip({
      boundary: 'window'
    })
    button.btn {
      margin: 1em;
    }
    
    .tooltip-inner {
      margin-left: 40px;
    }
    
    .tooltip-inner:before {
      content: "";
      position: absolute;
      background: black;
      height: 1px;
      width: 40px;
      left: 5px;
      top: 14px;
    }
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha2/css/bootstrap.min.css" integrity="sha384-DhY6onE6f3zzKbjUPRc2hOzGAdEf4/Dz+WJwBvEYL/lkkIsI3ihufq9hk9K4lVoK" crossorigin="anonymous">
    
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha2/js/bootstrap.bundle.min.js" integrity="sha384-BOsAfwzjNJHrJ8cZidOg56tcQWfp6y72vEJ8xQ9w6Quywb24iOsW913URv1IS4GD" crossorigin="anonymous"></script>
    
    <button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="right" title="Tooltip on right">
      Tooltip on right
    </button>