小编Tas*_*ple的帖子

在Google Chrome中设置拼写检查语言

我正在尝试创建一个简单的可编辑字段(用于发布),同时组合拼写检查:

<div contenteditable="contenteditable" spellcheck="spellcheck" lang="en">text</div>
Run Code Online (Sandbox Code Playgroud)

(http://www.wufoo.com/html5/attributes/17-spellcheck.html)

它有效,但在Google Chrome上,拼写检查程序无法检测到该语言.(尽管指定了@lang属性)

Firefox中修复了"bug":https://bugzilla.mozilla.org/show_bug.cgi?id = 338427

但我找不到任何关于谷歌Chrome的实现.有没有办法通知拼写检查器HTML5字段中的预期语言?或许真的在<head>charset,meta lang等?

html5 google-chrome

18
推荐指数
1
解决办法
6439
查看次数

沿SVG路径渲染RTL文本

尝试沿SVG中的路径呈现希伯来语文本会导致Chrome中的错误-字形向后(从左到右)呈现,使文本不可读。

字母倒退

<svg height="220" width="190">
    <defs>
         <path id="MyPath2" d="M0,100 L200,100" />
    </defs>
    <use xlink:href="#MyPath2" fill="none" stroke="red"  />
    <text text-anchor="middle" dx="100" dy="0" writing-mode="rl" direction="rtl">
        <textPath xlink:href="#MyPath2">
         ????? ??? ????? ????
        </textPath>
    </text>     
</svg>
Run Code Online (Sandbox Code Playgroud)

有办法解决这个问题吗?这是一个已知的错误,还是我应该使用的属性?

JSFIddle: http //jsfiddle.net/j9RnL/

html svg hebrew right-to-left

5
推荐指数
1
解决办法
1268
查看次数

更改 contentEditable div 的字体大小

我有一个contentEditable div

\n\n
<div id="editor" contentEditable="true"> Enter your text here.. </div>\n
Run Code Online (Sandbox Code Playgroud)\n\n

还有一个dropdown button

\n\n
<div class="btn-group">\n    <button class="btn dropdown-toggle" data-toggle="dropdown" title="Taille de police"><i class="fa fa-text-height"></i>&nbsp;<b class="caret"></b></button>\n    <ul class="dropdown-menu" id="tailles"></ul>\n</div>\n
Run Code Online (Sandbox Code Playgroud)\n\n

为了用项目填充此下拉列表,我正在使用此脚本:

\n\n
//Liste des tailles utilis\xc3\xa9\nvar tailles = [\n    \'Petite (8px)\',\n    \'Petite (10px)\',\n    \'Petite (12px)\',\n    \'Normale (14px)\',\n    \'Grande (18px)\',\n    \'Grande (24px)\',\n    \'Grande (36px)\'\n];\n\n    //R\xc3\xa9cuperer le drop down du Taille de police\n    var taillesDropDown = document.getElementById(\'tailles\');\n\n    //Population du drop down Taille du police\n    tailles.forEach(function(taille){\n        var li …
Run Code Online (Sandbox Code Playgroud)

html javascript css contenteditable

3
推荐指数
1
解决办法
9644
查看次数