Wrap text from bottom to top

I would not recommend using exotic CSS attributes which aren’t even in Chrome & Firefox yet. The best cross-browser solution is to handle this in Javascript when the document loads. Here’s a sketch of how to do that:

$(function() {
    $(".title").each(function(i,title) {
        var width = 0;
        var originalHeight = $(title).height();
        var spacer = $('<div style="float:right;height:1px;"/>').prependTo(title);
        while (originalHeight == $(title).height()) {
            spacer.width( ++width );
        }
        spacer.width( --width );
    });
});

Working JSFiddle is here: http://jsfiddle.net/zephod/hfuu3m49/1/

Leave a Comment