I have a bunch of hmtl buttons, some have a value like: "Title*" I would like the star to be colored red while the rest of the text is black. Is this possible?
I found this code suggestions to make the text colored:
<form>
<input type="button" value="this is a styled text button" style="color:#fff;">
</form>
Is something like this possible to modify so only parts of the text in value will be affected?
You need to use a span as others hav suggested. I would however completely avoid using inline css with the
style
attribute. Instead use classes. Its hard to recommend how exactly to apply the CSS without knowing the context of the usage but the following would be an example:HTML:
CSS:
put that
*
in a span likeUpdate :
Instead of
<input type="button"/>
you can use<button>
tag,and style its label: