Bootstrap Tutorial - Four directional Tooltip Placement








The following code shows how to four directional Tooltip Placement.

Example

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet"
  href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<link rel="stylesheet"
  href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">
<script type="text/javascript"
  src="http://code.jquery.com/jquery.min.js"></script>
<script
  src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){<!--from w w  w  . ja v  a  2s . c  o m-->
    $(".tip-top").tooltip({
        placement : 'top'
    });
    $(".tip-right").tooltip({
        placement : 'right'
    });
    $(".tip-bottom").tooltip({
        placement : 'bottom'
    });
    $(".tip-left").tooltip({
        placement : 'left'
    });
});
</script>
<style type="text/css">
.bs-example {
  margin: 50px;
}
</style>
</head>
<body>
  <div class="bs-example">
    <ul class="list-inline">
      <li><a href="#" data-placement="top" data-toggle="tooltip"
        class="tip-top" data-original-title="Tooltip on top">Tooltip on
          top</a></li>
      <li><a href="#" data-placement="right" data-toggle="tooltip"
        class="tip-right" data-original-title="Tooltip on right">Tooltip
          on right</a></li>
      <li><a href="#" data-placement="bottom" data-toggle="tooltip"
        class="tip-bottom" data-original-title="Tooltip on bottom">Tooltip
          on bottom</a></li>
      <li><a href="#" data-placement="left" data-toggle="tooltip"
        class="tip-left" data-original-title="Tooltip on left">Tooltip
          on left</a></li>
    </ul>
  </div>
</body>
</html>

Click to view the demo