可编辑属性html,contenteditable

contenteditable

版本:HTML5

一个枚举属性(enumerated attribute),表示元素是否可被用户编辑。如果可以,浏览器会调整元素的部件(widget)以允许编辑。true 或者空字符串,表明元素是可被编辑的;false,表明元素不能被编辑。

Edit this content to add your own quote

-- Write your own name here

.output {

font: 1rem 'Fira Sans', sans-serif;

}

blockquote {

background: #eee;

border-radius: 5px;

margin: 16px 0;

}

blockquote p {

padding: 15px;

}

cite {

margin: 16px 32px;

}

blockquote p::before {

content: '\201C';

}

blockquote p::after {

content: '\201D';

}

[contenteditable='true'] {

caret-color: red;

}

Edit this content to add your own quote-- Write your own name here

该属性必须是下面的值之一:true或空字符串,表示元素是可编辑的;

false表示元素不是可编辑的。

如果没有设置该属性,其默认值继承自父元素。

该属性是一个枚举属性,而非布尔属性。这意味着必须显式设置其值为true、false或空字符串中的一个,并且不允许简写为Example Label正确的用法是Example Label。

你可以使用CSScaret-color属性设置用于绘制文本插入caret的颜色。

浏览器支持f515c46b9f499a384336d07c62be2cfe.gife7c0b5a35e7876053962fd90a31d6acc.gif6f7088d28d6f7ea604e66cfba3b1e71d.gifbe610315b796c1b1d41a4e5496e268a7.gif2a97a8c5460fd66b35928591ac5b9c39.gif

IE、火狐浏览器不支持,其余浏览器支持contenteditable属性

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值