So I dont know exactly how to ask what I am looking for so I might just post pictures.
I have this box of which it contains of 2 divs next to each other. Div with border-right and the content div:

and here is the HTML structure:
<div id="box">
<div class="dblline">
</div>
<div contenteditable="true" class="content">
*content goes here*
</div>
</div>
Now as you can see, the place where the content is, is editable thus making its height expand as you type. The border-right div, has min-height so it can expand as the content area expands (?) but it doesn’t seem to work and here is question:
How can I expand the border too as the content expands so it doesnt look like this:

This is my CSS:
#box {width:200px;border:1px solid grey}
.dblline {border-right:3px solid rgba(0, 0, 0, .5);margin-left:15px;
min-height:200px;position:absolute}
.content {padding:10px 20px 10px 30px ;}
jsFiddle: http://jsfiddle.net/7tcWN/
Specific solution
This one is for browsers without Javascript. It just creates the border in the div of the text, therefore it automatically scales. Weakness: when browser highlight the box while editing they only highlight the part on the right of the vertical rule, which looks odd.
And now for the other one…
Complete jQuery solution
Unfortunately there is no
changeevent that works with this type of editable field. I have tested other events and came up with these required three:keyup– for normal typing,keydown– when you press and hold a key,mousemove– for drag and drop.Notice there’s a
mousemoveinstead ofmouseup, because text isn’t pasted yet, when the latter is triggered. You could probably get away withsetTimeouton such occasion, but to keep things simple I went withmousemove. Here’s the code (with extra debug logging when you uncomment one line):