如何使用contentEditable和大小样式删除调整大小的句柄和div的边框 [英] How to Remove Resize handles and border of div with contentEditable and size style

查看:874
本文介绍了如何使用contentEditable和大小样式删除调整大小的句柄和div的边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题是IE中的contentEditable属性。
问题是我得到调整大小的句柄,并且当它们聚焦时元素周围有一个粗边框。需要带有高度和高度的样式。
有关如何删除它们的任何想法? CSS或Javascript

The problem I'm having is with the contentEditable attribute in IE. The problem is that I'm getting resize handles, and a thick border around elements when they're in focus. The styles for with, height and display are needed. Any idea of how to remove them? CSS or Javascript

一个简单的例子:

<html>
<head>
</head>

<body>

<div contentEditable="true" style="width: 50%; height: 50%; display: table" >
<div contentEditable="true" style="width: 50%; height: 50%; display: table-cell">
<p>aaa</p>
</div>
</div>

</body>
</html>


推荐答案

我们可以将具有contenteditable值的外部div包装为false拿掉调整大小手柄。更新后的 jsfiddle

We can wrap the outer div with contenteditable value as false to take away the resize handles. Below the the updated jsfiddle

<div>
<div contentEditable="false" style="width:50%; height:50%; display:table" >
    <div contentEditable="true" style="width:50%; height:50%; display:table-cell" >  
        <p>div1</p> 
    </div>  
</div>

<div contentEditable="false" style="width:50%; height:50%; display:table" >
    <div contentEditable="true" style="width:50%; height:50%; display:table-cell" >  
        <p>div2</p> 
    </div>  
</div>

这篇关于如何使用contentEditable和大小样式删除调整大小的句柄和div的边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆