textarea
默认有个resize
样式,效果就是下面这样css
读 《css 揭秘》时发现两个亮点:html
textarea
元素,适用于下面全部元素:elements with overflow other than visible, and optionally replaced elements representing images or videos, and iframeside
resize
功能,可是其余元素不行。这一点,可能不太好理解,举个例子,咱们用一个span
来覆盖右下角的按钮spa
<div> div <span> span </span> </div>
div { width:100px; height:100px; background-color:pink; resize:horizontal; overflow:hidden; position:relative; } span { content:''; display:block; width:20px; height:20px; background-color:yellowgreen; position:absolute; right:0; bottom:0; }
效果是这样,resize
功能失效了:code
可是,若是把 span
换成伪元素,就是能够的:htm
<div> div <span> span </span> </div>
div { width:100px; height:100px; background-color:pink; resize:horizontal; overflow:hidden; position:relative; } div::after { content:''; display:block; width:20px; height:20px; background-color:yellowgreen; position:absolute; right:0; bottom:0; }
resize
功能仍是在的:blog
这就很是神奇了。element