Demo button { border: .1em solid black; background: transparent; color: black; } button:hover { background: black; color: white; } button.pink { border-color: #f06; color: #f06; } button.pink:hover { background: #f06; color: white; } <button>Click me</button> <button class="pink">Click me</button> [ {"type":"caret","start":63,"end":63,"editor":"css"}, {"type":"insertText","text":"--","split":true}