• <legend id='hZ6vC'><style id='hZ6vC'><dir id='hZ6vC'><q id='hZ6vC'></q></dir></style></legend>
    • <bdo id='hZ6vC'></bdo><ul id='hZ6vC'></ul>
    <i id='hZ6vC'><tr id='hZ6vC'><dt id='hZ6vC'><q id='hZ6vC'><span id='hZ6vC'><b id='hZ6vC'><form id='hZ6vC'><ins id='hZ6vC'></ins><ul id='hZ6vC'></ul><sub id='hZ6vC'></sub></form><legend id='hZ6vC'></legend><bdo id='hZ6vC'><pre id='hZ6vC'><center id='hZ6vC'></center></pre></bdo></b><th id='hZ6vC'></th></span></q></dt></tr></i><div id='hZ6vC'><tfoot id='hZ6vC'></tfoot><dl id='hZ6vC'><fieldset id='hZ6vC'></fieldset></dl></div>
      1. <tfoot id='hZ6vC'></tfoot>

        <small id='hZ6vC'></small><noframes id='hZ6vC'>

      2. 更改文本框 HTML/CSS 中一个字符的颜色

        时间:2023-08-07
      3. <i id='rciKI'><tr id='rciKI'><dt id='rciKI'><q id='rciKI'><span id='rciKI'><b id='rciKI'><form id='rciKI'><ins id='rciKI'></ins><ul id='rciKI'></ul><sub id='rciKI'></sub></form><legend id='rciKI'></legend><bdo id='rciKI'><pre id='rciKI'><center id='rciKI'></center></pre></bdo></b><th id='rciKI'></th></span></q></dt></tr></i><div id='rciKI'><tfoot id='rciKI'></tfoot><dl id='rciKI'><fieldset id='rciKI'></fieldset></dl></div>

      4. <tfoot id='rciKI'></tfoot>

            <bdo id='rciKI'></bdo><ul id='rciKI'></ul>
                <tbody id='rciKI'></tbody>
            • <legend id='rciKI'><style id='rciKI'><dir id='rciKI'><q id='rciKI'></q></dir></style></legend>

              <small id='rciKI'></small><noframes id='rciKI'>

                  本文介绍了更改文本框 HTML/CSS 中一个字符的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在设计一个网站,我想问你们,如何通过 CSS 更改 HTML 文本框中字符串中的一个字符的颜色?

                  I'm designing a web site and i would like to ask you guys that, how can I change the color of just one character in a string in a text box of HTML by CSS?

                  示例:STACK OVER FLOW 只有A"字母是红色的!

                  example : STACK OVER FLOW just the 'A' letter is red!

                  谢谢大家

                  推荐答案

                  你不能用常规的 <input type="text"><textarea> 元素,但使用普通元素(如 <div><p>)使 contenteditable,你有html/css 格式的所有自由.

                  You can't do this with a regular <input type="text"> or <textarea> element, but with a normal element (like <div> or <p>) made contenteditable, you have all the freedoms of html/css formatting.

                  <div contenteditable>
                      ST<span style="color: red">A</span>CK OVERFLOW
                  </div>
                  

                  http://jsfiddle.net/jVqDJ/

                  浏览器支持也很好(IE5.5+).在 https://developer.mozilla.org/en-US/阅读更多内容docs/Web/HTML/Content_Editable

                  The browser support is very good as well (IE5.5+). Read more at https://developer.mozilla.org/en-US/docs/Web/HTML/Content_Editable

                  这篇关于更改文本框 HTML/CSS 中一个字符的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在文本框的焦点上设置光标长度为 14 下一篇:通过以编程方式更改文本框值来调用 Javascript o

                  相关文章

                  最新文章

                  <small id='8UsoK'></small><noframes id='8UsoK'>

                    <bdo id='8UsoK'></bdo><ul id='8UsoK'></ul>
                  <i id='8UsoK'><tr id='8UsoK'><dt id='8UsoK'><q id='8UsoK'><span id='8UsoK'><b id='8UsoK'><form id='8UsoK'><ins id='8UsoK'></ins><ul id='8UsoK'></ul><sub id='8UsoK'></sub></form><legend id='8UsoK'></legend><bdo id='8UsoK'><pre id='8UsoK'><center id='8UsoK'></center></pre></bdo></b><th id='8UsoK'></th></span></q></dt></tr></i><div id='8UsoK'><tfoot id='8UsoK'></tfoot><dl id='8UsoK'><fieldset id='8UsoK'></fieldset></dl></div>
                    1. <tfoot id='8UsoK'></tfoot><legend id='8UsoK'><style id='8UsoK'><dir id='8UsoK'><q id='8UsoK'></q></dir></style></legend>