Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have it working in FF using some Javascript (javascript). I haven't got it working with the ellipses yet - but with a little more work its doable (using the background image approach).</p> <p>Copy paste this into a .html file to see a proof of concept - when loaded resize your browser winder so its narrower to see it automatically shift stuff around and give you the wrapping effect you want.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;test&lt;/title&gt; &lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js'&gt;&lt;/script&gt; &lt;style type='text/css'&gt; .author, .title { overflow:hidden; text-overflow: ellipsis; white-space: nowrap; } .title, .date { float: left; } .date { margin-left:10px; } .author { background-color: red; color: white; } .title { background-color: blue; color: white; } .date { background-color: green; color: white; } &lt;/style&gt; &lt;script type='text/javascript'&gt; $.resizeHeader = function() { var _title = $('#title'); var _date = $('#date'); var _container = $('#headingContainer'); _title.css('width','auto'); var _containerWidth = _container.width(); var _titleWidth = _title.outerWidth(true); var _dateWidth = _date.outerWidth(true); if ((_dateWidth+_titleWidth)&gt;_containerWidth) { var _deltaWidth = (_dateWidth+_titleWidth)-_containerWidth; var _newTitleWidth = _titleWidth-_deltaWidth; _title.width(_newTitleWidth); } } $(function() { $(window).resize(function() { $.resizeHeader(); }).resize();; }) &lt;/script&gt; &lt;/head&gt; &lt;div id='headingContainer'&gt; &lt;div class="author"&gt;This is an author title&lt;/div&gt; &lt;div&gt; &lt;span class="title" id='title'&gt;This is the title which is very long and prone to spill over and over and over and over and over&lt;/span&gt; &lt;span class="date" id='date'&gt;The Date&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/html&gt; </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