删除复制+粘贴的富文本格式? (跨浏览器)
16lz
2021-01-22
I'm not sure whether a Javascript or CSS fix could fix this issue on my site. This seems to only happen with Chrome (not sure about IE, yet).
我不确定Javascript或CSS修复程序是否可以在我的网站上修复此问题。这似乎只发生在Chrome上(还不确定IE)。
Whenever a user copies text from my AspDotNetStorefront site and paste it onto a Word document, the pasted text includes a gray background. Is there anything I can do on my site to prevent this rich text formatting paste feature onto documents?
每当用户从我的AspDotNetStorefront站点复制文本并将其粘贴到Word文档时,粘贴的文本都包含灰色背景。我可以在我的网站上做些什么来阻止这种富文本格式粘贴功能到文档中吗?
I'm not sure what would be the cause of this besides Microsoft Word's default paste setting.
除了Microsoft Word的默认粘贴设置,我不确定这是什么原因。
4 个解决方案
#1
1
.unselectable{
position:absolute;
z-index:1;
color:green;
-webkit-user-select:none;
}
.selectable{
position:absolute;
z-index:2;
color:rgba(0,0,0,0);
-webkit-user-select:text;
}
<p class="unselectable">Lorem</p>
<p class="selectable">Lorem</p>
更多相关文章
- 在导航图标css下包装文本。
- 如何添加文本描述以指向谷歌地图API
- 如何在选择单选按钮时显示文本字段
- 包含HTML和JavaScript标记的HTML选择控件作为文本
- 将输入文本字段显示为纯文本
- javascript添加两个文本框值,并在asp.net中显示为第三
- 在用户将'n'粘贴复制到文本字段后,如何更新视图模型?
- jquery.fullCalendar官方文档翻译(一款小巧好用的日程管理日历,
- Javascript警报中文本的颜色