Only an HTML5 note goes beyond the tags, so the resolution here is not quite this one. In case only HTML and CSS have no way to do.
I do not quite understand what you mean by arrow and come down automatically, until I know when I press Enter or the text breaks line scroll scrolls normally, maybe what you want is that textarea
increase?
It is possible using Javascript and capturing the height of the scroll by manipulating the css then, for example:
function addEvent(type, el, callback)
{
if (window.addEventListener) {
el.addEventListener(type, callback, false);
} else if (window.attachEvent) {
el.attachEvent("on" + type, callback);
} else {
el["on" + type] = callback;
}
}
function resizeTextfield(el)
{
var timer;
function trigger() {
if (!el) { return; }
el.style.height = "auto";
var height = el.scrollHeight;
el.style.height = height + "px";
}
function exec() {
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(trigger, 10);
}
addEvent("keyup", el, exec);
addEvent("input", el, exec);
}
window.onload = function () {
var els = document.getElementsByClassName("increase");
for (var i = els.length - 1; i >= 0; i--) {
resizeTextfield(els[i]);
}
};
.increase
{
width: 480px;
min-height: 240px; /*altura minima*/
overflow: hidden;
resize: none; /* pode trocar por resize: vertical; se quiser permitir redimensionar manualmente na vertical*/
}
<textarea class="increase"></textarea>