positioning a popover using twitter bootstrap

css, jquery, twitter-bootstrap

Solution

You can add to the styles of the standard popover layout to move the popover where you want. Here is the standard popover layout taken directly from bootstrap-popover.js:

<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>

Therefore to move it say 15px to the right you can add the following to your style:

.popover {margin-left: 15px;}

Problem

if I have a popover on an `<a>` element and call it as follows ``` $(function () { $('#element').popover({ placement:'top', title:'some title', content: $('#some-div').html() }); }); ``` the popover displays top center of the element, how do I get the popover to display top-right or top left of the element?

Original source