Fixed filling in content element

Filling is textareaalways fixed. When the text content of the text area scrolls, the indentation remains near the edges.

Filling an contenteditableelement behaves differently. When the text content of an element scrolls, the pad moves with it.

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?

+6
source share
2 answers

, , textarea, " ", , - "".

, , div, div , .

"contenteditable". "cnotenteditable = true" div, . Padding " " , div. , div.

+2

2019 . :

border: 10px solid black;
background: black;
color: white;

. : https://jsfiddle.net/shill/2k81acux/

0

Source: https://habr.com/ru/post/1568424/


All Articles