Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic width floated div with nested floated blocks
    primarykey
    data
    text
    <p>I have a template with a content area in which I want to add a centered navigation block. The navigation block is supposed to look like this:</p> <pre> |----|-------------------|----| | &lt&lt | 1 2 3 4 5 6 7 8 9 | &gt;&gt; | |----|-------------------|----| </pre> <p>There are 3 blocks: the right and the leftmost ones are divs containing an "a" element with display: block, fixed width/height and a background image.<br> The middle block contains a variable amount of links (which means that I can't set the width), each one with display: block and a border around them, all floated left, just like the 3 upper-level blocks.<br> Now, this is my relevant code: </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>div#pagination { margin: 0 auto; display: table; overflow: hidden; } .goleft { float: left; } a.prev-btn, a.next-btn { width: 30px; height: 26px; display: block; } div.pagination { height: 25px; overflow: hidden; padding: 4px, 10px 0 5px; background-color: #141414; } div.pagination a { float: left; padding: 2px; color: #fefffe; text-align: center; border: 1px solid #51ae1b; display: block; margin-left: 8px; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="content"&gt; &lt;div id="pagination"&gt; &lt;a href="#" class="prev-btn goleft"&gt;&lt;/a&gt; &lt;div class="pagination goleft"&gt; &lt;a href="#"&gt;1&lt;/a&gt; &lt;a href="#"&gt;2&lt;/a&gt; &lt;a href="#"&gt;3&lt;/a&gt; &lt;/div&gt; &lt;a href="#" class="prev-btn goleft"&gt;&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p>The problem with this code, is that it doesn't quite work on firefox, and works even worse on opera.<br> On opera, with enough links in the middle div, the left and right divs are always above and below the middle div, respectively.<br> On FFox, the right div seems to stay in place or go below the other 2 divs, but not consistently.<br> On both, the middle div is longer than the elements within, and I really can't understand why it does that - if I set a width everything is fine, but it's really not possible.<br> What am I doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    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