2017-08-25 5 views
-7

textareaのボトムパッドを削除するには?テキストエリアの下の詰め物を削除するには?

$('textarea').css("height", $("textarea").prop("scrollHeight"))
textarea { 
 
    width: 300px; 
 
    resize: none; 
 
    margin: 0; 
 
    padding: 0; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<textarea> 
 
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a </textarea>

+1

パディングはありません。 – PRAISER

+0

どのブラウザをお使いですか? –

+0

あなたはこのhttps://stackoverflow.com/questions/995168/textarea-to-resize-based-on-content-length – Kiwad

答えて

1

あなたは

オーバーフロー-Yを使用する必要があります。folows

$('textarea').css("height", $("textarea").prop("scrollHeight"))
textarea { 
 
    width: 300px; 
 
    resize: none; 
 
    margin: 0; 
 
    padding: 0; 
 
    overflow-y: hidden; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<textarea> 
 
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a </textarea>

として

を隠さ

関連する問題