Change color of one character in a text box HTML/CSS

后端 未结 7 2062
南笙
南笙 2020-12-01 12:24

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?

example

7条回答
  •  没有蜡笔的小新
    2020-12-01 12:54

    From css you can only change an elements property so you need to insert the letter "A" in another element like this:

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

    And the CSS part is

    span{
       color:#FF0000;
    }
    

    Or attach a class to it like this

    STACK OVER FLOW just the '

    CSS:

    span.myRedA{
           color:#FF0000;
        }
    

提交回复
热议问题