Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Without javascript, the only solution that I think would work is giving a <code>max-width</code> of 50% to each, and a <code>text-overflow</code> with an ellipsis (…) when the text overflows...</p> <p>The only problem is if for instance the name is very small, if the email is very big it will ocupy only 50% of the full width.</p> <p>I made this fiddle: <a href="http://jsfiddle.net/N36tY/" rel="nofollow">http://jsfiddle.net/N36tY/</a></p> <p>(also I agree with cimmanon, use other tags)</p> <p>Example HTML:</p> <pre><code>&lt;div class='result'&gt; &lt;div class='textHolder'&gt; &lt;h3&gt;Name&lt;/h3&gt; &lt;h4&gt;Email&lt;/h4&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;h3&gt;Name and more text, etc and even more to make it overflow&lt;/h3&gt; &lt;h4&gt;Email&lt;/h4&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;h3&gt;Name and more text, etc and even more to make it overflow&lt;/h3&gt; &lt;h4&gt;Email and a lot of text and more and even more to make it overflow&lt;/h4&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;h3&gt;Small name&lt;/h3&gt; &lt;h4&gt;Email and a lot of text and more and even more to make it overflow&lt;/h4&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS:</p> <pre><code>.textHolder { width: 100%; } h3 { background: blue; color: #FFF; } h4 { background: green; color: #FFF; } h3, h4 { margin: 0; padding: 0; font-size: 14px; font-weight: normal; display: block; float: left; min-width: 10px; max-width: 50%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } .clear { clear: both; } </code></pre>
 

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