javascript - 样式“text-stroke”是否有任何 document.execCommand()?
问题描述
我正在尝试使用 document.execCommand('') 来制作一个文本编辑器,我希望用户能够在其中以不同颜色勾勒(描边)文本。就像下面的代码:
<p style="-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color:rgb(125, 255, 136); font-size:40px;">Text Sample</p>
我希望用户在单击按钮时执行此操作。
喜欢设置字体颜色,我们使用:
document.execCommand('color', false, color);
我想要文本笔划的类似功能。
$('stroke').click(()=> {
document.execCommand('command_for_the_text_stroke??', false, color)
}) // this is the format
如果您能提供帮助,那就太好了。祝你有美好的一天!
解决方案
推荐阅读
- r - R:使用转换表更新 data.frame 中的行名
- r - 根据涉及其他列的公式创建新列
- java - 从递归解决方案构建最大子阵列动态规划解决方案
- php - 无重复数字的 PHP 随机数
- vue.js - 使用 Gridsome 修改 Vue.js 项目中的路由器元字段
- javascript - 需要一个动态的 Tooltip,它将指示 React 中 Canvas 彩色区域的百分比
- android - 密钥库和私钥迁移
- html - 使用ngmodel始终显示2位小数的角度输入标签并在接收输入时限制2位小数?
- android - 当我使用媒体播放器和搜索栏时,如何跟踪帧序列?
- kdb - KDB/q:如何更新包含不同列的行的表?