neo33 neo33 - 5 months ago 8
CSS Question

How to change the behavior of the following css button?

Hello I am working in the following small page, I have two buttons, one to hide a textarea and the other to show it, in fact they work well however I would like to color the buttom called: Hide in green, in order to do it I tried:

<div class="wrapper">
<button class="button buttom2" style="vertical-align:middle" onclick="hide()" background-color= "green"; ><span>Hide</span></button>
</div>


but It doesn't affect the behavior of my button, I would like to appreciate any suggestion to fix the problem, I created the following jsfiddle file to show the problem:

https://jsfiddle.net/12bkgd4q/9/

Answer

You are setting background-color= "green"; outside style attribute, you need to put it inside style attribute

<button class="button buttom2" style="vertical-align:middle;background-color:green" onclick="hide()";><span>Hide</span></button>

JSFIDDLE