html - How do I make a contenteditable='false' div have the same height as a contenteditable='true'? -


i have div that's been used "input" using contenteditable, , works great when enabled. there's 1 scenario need disable "input" setting contenteditable='false', makes div lose height (as can see in this jsfiddle).

<div contenteditable="true" class="visible-borders"></div> <div contenteditable="false" class="visible-borders"></div> 

do guys have solution that? wanted didn't involve min-height. , no, cannot change code use other contenteditable. i'm using else's code.

this because contenteditable=false div has no content , nothing holding open, whereas content-editable element has default styling shows editable (specifically: -webkit-user-modify: read-write)

you give .visible-borders min-height. if (for unspecified reason) don't want use min-height, insert pseudo content:

.visible-borders:before {     content: "\00a0" } 

https://jsfiddle.net/a5c7fo9c/6/


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -