Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to adjust word-wrapped text's width when it exceed containers max-width ? (HTML)
    primarykey
    data
    text
    <p>Im trying to put some text info on thumbnails, the info box is floating to the left and should not exceed max-width:85%; (of the thumbnail). Thumbnail area is marked light gray in the picture, text info area is yellow.</p> <p>When the text exceed the with, text holding element ocupies full 85% and word wraps to next line. My problem is that there are extra white spaces on the first line, which I would like gone. </p> <p>In my project yellow area holds Thumbnail title, even though there are few words in it, sometimes it just leaves big gaps on the first line which look bad.</p> <p>Is there any way to fix this or am I asking for too much ?</p> <p><a href="http://jsfiddle.net/fvdJm/" rel="nofollow noreferrer">jsFiddle demo</a></p> <p><img src="https://i.stack.imgur.com/e3UpF.png" alt="enter image description here"></p> <p>HTML</p> <pre><code>&lt;div id="main"&gt; &lt;div id="text"&gt; &lt;h3&gt;Some text and line breaking words. Some text and line breaking words. Soaaaaame text and line breaking words.&lt;h3&gt; &lt;/div&gt; </code></pre> <p></p> <p>CSS</p> <pre><code>#main { width:100%; background-color:#ccc; } #text { display:inline-block; max-width:85%; background-color:yellow; } </code></pre> <p>EDIT: text-align:justify only does the job when there are enough words. Take a look at this:</p> <p><strong>WITH JUSTIFY</strong></p> <p><img src="https://i.stack.imgur.com/doHKV.png" alt="enter image description here"></p> <p><strong>WITHOUT</strong></p> <p><img src="https://i.stack.imgur.com/NEhch.png" alt="enter image description here"></p>
    singulars
    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.
    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