Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS - display inline-block strange behaviour with text on new line
    text
    copied!<p>This is my <a href="http://jsfiddle.net/sMyGV/2/" rel="nofollow">code</a> :</p> <h1>CSS</h1> <pre><code>div { height:30px; } .prodotto_pulsante_testo_centrato { display:block; text-align:center; margin-left:auto; margin-right:auto; width:120px; } .prodotto_pulsante_testo_numero { display:inline-block; width:23px; position:absolute; left:-31px; bottom:-1px; background-color:green; } .prodotto_pulsante_testo_titolo { display:inline-block; margin-left:23px; position:relative; background-color:red; text-align:left; } </code></pre> <h1>HTML</h1> <pre><code>&lt;div&gt; &lt;span class="prodotto_pulsante_testo_centrato"&gt; &lt;span class="prodotto_pulsante_testo_titolo"&gt; operativo &lt;span class="prodotto_pulsante_testo_numero"&gt;4&lt;/span&gt; &lt;/span&gt; &lt;/span&gt; &lt;/div&gt; &lt;div&gt; &lt;span class="prodotto_pulsante_testo_centrato"&gt; &lt;span class="prodotto_pulsante_testo_titolo"&gt; sportello operativo &lt;span class="prodotto_pulsante_testo_numero"&gt;4&lt;/span&gt; &lt;/span&gt; &lt;/span&gt; &lt;/div&gt; </code></pre> <p>the red boxes are <code>display:inline-block;</code>. The longest word in the boxes is "operativo", so I aspect they will be aligned to the same vertical line.</p> <p>But, on second box, I have a new line on the text, cause of the 120px of the parent div, which push <code>prodotto_pulsante_testo_titolo</code> to a highest width.</p> <p>Why this behaviour? I suppose that is correct : the same on Firefox and Chrome. It works as I aspect on IE :)</p>
 

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