Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery/css wrap text bottom up

I am trying to wrap text in a div using css and/or jQuery such that the bottom line is the longest.

so rather than

__________
|this is |
|text    |
|________|

it would say

__________
|this    |
|is text |
|________|

I can easily wrap the text using

    white-space: pre-wrap;

But i can't find anything that would let me do this.

(one thought i had would be to reverse the text, find where the line wrapping happens, apply a <br/> in the same places, with the text going forward.. but i dont know how to check where the line wraps)

like image 657
BananaNeil Avatar asked Nov 13 '22 05:11

BananaNeil


1 Answers

Their is a plugin in jquery called bacon

With this you can wrap text according to your needs in any shape you want, I know you have to do a stuff over it but I think it may help you .

$(".baconMe").bacon({
    'type' : 'bezier',
    'c1' : { x : 10,        y : 0  },
    'c2' : { x : -115,      y : 170 },
    'c3' : { x : 35,        y : 340 },
    'c4' : { x : 15,        y : 480 },
    'align'  : 'right'
}
like image 177
Ankur Verma Avatar answered Nov 16 '22 04:11

Ankur Verma