【css】textarea-通过resize:none 禁止拖动设置大小

使用 resize 属性可防止调整 textareas 的大小(禁用右下角的"抓取器"):

没有设置resize:none

代码:

xml 复制代码
<!DOCTYPE html>
<html>
<head>
<style> 
textarea {
  width: 100%;
  height: 150px;
  padding: 12px 20px;
  box-sizing: border-box;
  border: 2px solid #ccc;
  border-radius: 4px;
  background-color: #f8f8f8;
  font-size: 16px;
}
</style>
</head>
<body>
<form>
  <textarea>Some text...

渲染效果:可以拖动设置大小

添加resize:none

xml 复制代码
<!DOCTYPE html>
<html>
<head>
<style> 
textarea {
  width: 100%;
  height: 150px;
  padding: 12px 20px;
  box-sizing: border-box;
  border: 2px solid #ccc;
  border-radius: 4px;
  background-color: #f8f8f8;
  font-size: 16px;
  resize:none;
}
</style>
</head>
<body>
<form>
  <textarea>Some text...

渲染效果:

相关推荐
We་ct21 分钟前
React 性能优化精讲
前端·javascript·react.js·性能优化·前端框架·html·浏览器
云动课堂32 分钟前
【运维实战】Nginx 高性能Web服务 · 一键自动化部署方案 (适配银河麒麟 V10 / openEuler / CentOS 7/8)
运维·前端·nginx
渣渣盟1 小时前
Spark 性能调优实战:从开发到生产落地
javascript·ajax·spark
大前端helloworld2 小时前
AI全自动实现Flutter蓝牙自动连接
前端
GISer_Jing2 小时前
从入门到落地:前端开发者的AI Agent全栈学习路线
前端·人工智能·ai编程
计算机安禾2 小时前
【Linux从入门到精通】第47篇:SystemTap与eBPF——Linux内核观测的显微镜
java·linux·前端
技术钱3 小时前
OutputParser输出解析器
linux·服务器·前端·python
专科3年的修炼3 小时前
uni-app移动应用开发第四章
开发语言·javascript·uni-app
可达鸭小栈4 小时前
易语言实现CSS像素文字生成器:无需字体文件渲染汉字
前端·css
fox_lht4 小时前
DBeaver的LightGrid 类所有函数详细分析
前端