Loading video...

Video Failed to Load

Go Home

今天又学了一个新的 css 属性:field-sizing 是我最近学到的最有用的属性了,可以实现根据输入的 content 实现可变宽高的 textarea,当我写了半天 js 实现对应的效果,发现 CSS 可以很轻松的实现对应的效果了。 而且针对响应性设计使用这个属性会非常的方便。

52,709 views • 2 years ago •via X (Twitter)

10 Comments

0xE31's profile picture
0xE312 years ago

没有受到广泛支持的 css 属性等于不存在

一丝's profile picture
一丝2 years ago

不支持的浏览器可以用 CSS grid 模拟。

woody lee's profile picture
woody lee2 years ago

我用editable-content的div来实现

阿欢课堂's profile picture
阿欢课堂2 years ago

放在以前,我会用contenteditable这个属性,把div伪装成输入框……

Rei's profile picture
Rei2 years ago

safari 和 firefox 还不支持。

Chuck Chen's profile picture
Chuck Chen2 years ago

目前仅chrome系支持比较完善,等待其他浏览器赶上。

Pengcheng Cui's profile picture
Pengcheng Cui2 years ago

cool,但还得等等

我就是我's profile picture
我就是我2 years ago

现在只敢说认识CSS这三个字母

VaynePeng's profile picture
VaynePeng2 years ago

还是一个实验性语法,可以先用 div + absolute 实现

weedman's profile picture
weedman2 years ago

太牛了,一直没找到js怎么实现

Related Videos