There is some way to ignore the css style on copy?

耗尽温柔 提交于 2021-01-05 17:42:05

问题


Example:

<p style="color:blue; font-family:Consolas">blue text</p>

The user select the text, copy and paste (wysiwyg, word, etc). And the text comes without blue color and consolas font?

From browser to browser = simple content to wysiwyg

From browser to word

There's a manual with keywords that can be used on content. The users usually copy the keywords directly from manual and paste in the editor. So the editor assumes the style of the manual. And that's what I don't want. I can disable the select or change the tags of keywords to input and style it, but exists a easy way?


回答1:


This is a native OS/software feature. This is not something you can control via js/html.

You can however build a function via javascript that copies that text to clipboard.

Or search for the native feature in your options to turn it off.




回答2:


This is default in all the windows operating systems. when ever you select the text the blue color will occur in select area. manually we never change the color. i think this answer very usefull to you.....



来源:https://stackoverflow.com/questions/11802083/there-is-some-way-to-ignore-the-css-style-on-copy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!