I have an input button element which I would like to include the words "Take me there >" but I want to make the angle bracket a different color from the rest of the text.
Is this possible? I'm happy to use a javascript or jquery fix if necessary.
I have an input button element which I would like to include the words "Take me there >" but I want to make the angle bracket a different color from the rest of the text.
Is this possible? I'm happy to use a javascript or jquery fix if necessary.
Share Improve this question asked Jul 17, 2012 at 9:19 TomTom 13k50 gold badges153 silver badges247 bronze badges 1- 1 why not trying a div with CSS formatting and use as a button by using jQuery. – Riz Commented Jul 17, 2012 at 9:21
2 Answers
Reset to default 8How about this: http://jsfiddle/w3KHd/1/
Use a button with a span inside which sets the font color to whatever color you want. E.g.:
<button>Take me there <span style="color: red"> > </span></button>
Update:
If you want to use the button as a submit button use:
<button type="submit">Take me there <span style="color: red"> > </span></button>
If you can use <button>
instead of <input type="button">
you can use "first-letter" Pseudo Class as below.
Your style class:
<style>
button:first-letter {
color:red;
}</style>
Button:
<button type="submit"><Take me there ></button>