css - Auto widht and height in textarea -


i tried on several questions, have not found answer.

how textarea set according size of pattern "texdtart"?

#entry{float:center;clear:both;margin-top:40px;margin-bottom:25px;margin-left:auto;margin-right:auto;}  #entry textarea{margin-left:auto;margin-right:auto;line-height:100%;text-align:left;margin-top:0px;display:block;
<div id="entry"><form><textarea class="textarea3" onclick="this.focus();this.select()" readonly="readonly" style=" width:"";height"">  _________________§§§§§§§§__________§§_____§§  _______________§§________§§_______§§§§___§§§§  _____________§§__§§§§§§§§__§§______§§_____§§  ____________§§__§§______§§__§§______§§___§§  ___________§§__§§___§§§__§§__§§_____§§§§§  ___________§§__§§__§__§__§§__§§_____ §§§§§  ___________§§__§§__§§___§§§__§§_____§§§§§  ___________§§__§§___§§§§§§__§§_____§§§§§§  ____________§§__§§_________§§_____§§§§§§  _______§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§  ___§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§  ___§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§    </textarea></form></div>

i dont think possible directly through css. can achieve using javascript or jquery. try this:

$(document).ready(function(){     $(".textarea3").css("width", $(".textarea3:first").get(0).scrollwidth);     $(".textarea3").css("height", $(".textarea3:first").get(0).scrollheight+10); }); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -