Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does this a element have its size set to 0px x 0px when positioned using 'relative'?
    primarykey
    data
    text
    <p>I have been using <a href="http://www.zurb.com/playground/javascript-annotation-plugin" rel="nofollow noreferrer">this JavaScript image annotation plugin</a> to add annotations to a project - I managed to get it working correctly on a blank web page with just this HTML:</p> <pre><code>&lt;div id="sample-image"&gt; &lt;img src="img.jpg"&gt;&lt;/img&gt; &lt;/div&gt; </code></pre> <p>And this CSS for the annotations:</p> <pre><code>.circle { border-radius: 50%/50%; width: 20px; height: 20px; background: black; } </code></pre> <p>This produces the correct result...</p> <p><img src="https://i.stack.imgur.com/JiKLU.png" alt="example showing correct positioning"></p> <p>However when I went to add this to another project, using Twitter's Boostrap and this HTML</p> <pre><code>&lt;div class="container-fluid"&gt; &lt;div class="row-fluid"&gt; &lt;div data-spy="affix" data-offset-top="200" class="span3"&gt; &lt;div class="well sidebar-nav"&gt; &lt;ul class="nav nav-list"&gt; &lt;li&gt;&lt;a href="#contact"&gt;Contact&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="float:right" class="span9"&gt; &lt;div id="sample-image"&gt; &lt;img src="img.jpg"&gt;&lt;/img&gt; &lt;/div&gt; &lt;/div&gt; ... </code></pre> <p>The elements are positioned to the top of the page because by default they have position: aboslute property like so:</p> <pre><code>&lt;a class="circle" data-toggle="tooltip" data-placement="top" data-original-title="Church" rel="tooltip" onmouseover="$(this).tooltip('show')" style="left: 406px; top: 247px; position: absolute;"&gt;&lt;/a&gt; </code></pre> <p>Changing this to position: relative causes them to be placed correctly but their size is set to 0px x 0px according to Chrome so they are not displayed.</p> <p>Any ideas why this might be?</p> <p>Thanks, Jake</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload