I have a script that generates text when a user press a button. This text is sent to an input box, so when I press the button some text appears in one input box.
I would like to know if there's any CSS property to style the color of all the "-" characters that appear in the input box dividing the numbers.
Example of the generated txt: "4 - 6 - 9 - 8 - 2"
In other words I want the numbers red and the "-" blue.
I would love to know how I can do this. I would be very much appreciated.
Complete HTML/CSS Course 2022 The HTML <input> tag is used to get user input in HTML. To give a limit to the input field, use the min and max attributes, which is to specify a maximum and minimum value for an input field respectively. To limit the number of characters, use the maxlength attribute.
The CSS style can be set to a character in vertically half or horizontally half both. Add a class on the text and the class contains CSS style to apply half of the character. The accessibility of the main text is preserved with screen readers for the blind or visually impaired.
A style attribute on an <input> tag assigns a unique style to the input control. Its value is CSS that defines the appearance of the input element.
You can't have multi-styled text within a input:text
element. You'll need to use a custom text element using a div
with contenteditable
if you want formatted text.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With