<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>div可以编辑</title>
<style>
.box {
border: 1px solid red;
margin: 10px;
min-height: 100px;
width: 300px;
}
.box1 {
-webkit-user-modify: read-only;
-moz-user-modify: read-only;
}
.box2 {
/*支持富文本*/
-webkit-user-modify: read-write;
-moz-user-modify: read-write;
}
.box3 {
/*几乎没有浏览器支持*/
-webkit-user-modify: write-only;
-moz-user-modify: write-only;
}
.box4 {
/*只能输入文本*/
-webkit-user-modify: read-write-plaintext-only;
-moz-user-modify: read-write-plaintext-only;
}
</style>
</head>
<body>
<div class="box box1">只读</div>
<div class="box box2">可编辑富文本</div>
<div class="box box3"></div>
<div class="box box4">只能输入文本</div>
</body>
</html>
user-modify实现div可编辑、只读
最新推荐文章于 2023-08-19 16:04:47 发布