Filling is textareaalways fixed. When the text content of the text area scrolls, the indentation remains near the edges.
textarea
Filling an contenteditableelement behaves differently. When the text content of an element scrolls, the pad moves with it.
contenteditable
This demo illustrates the difference.
Can an contenteditableelement be styled so that its indentation looks more like filling textarea, remaining in place while the text content scrolls?
, , textarea, " ", , - "".
, , div, div , .
"contenteditable". "cnotenteditable = true" div, . Padding " " , div. , div.
2019 . :
border: 10px solid black; background: black; color: white;
. : https://jsfiddle.net/shill/2k81acux/
Source: https://habr.com/ru/post/1568424/More articles:Create a new date in the aggregation pipeline using re-scalaWhy is my LabView while loop running too many times? - while-looponOptionsItemSelected, return super.onOptionsItemSelected (item) explanation - javaWhether there is a. ThenCompose () for CompletedFuture, which also runs exclusively? - javaDropzone.js retries if ajax failed - javascriptOmit type = "text" on input that is considered bad practice? - htmlCreate custom documents (PDF files) on the fly on a website - linuxGoogle Guava Optional - Like Short-Circuit Expressions with Multiple Chains - javaIs it good to use counters? - performanceШрифт Удивительные значки для узлов дерева Webix - htmlAll Articles