I have created a button that is supposed to switch the background color from black to blue. However, I am having trouble finding an easy solution to do so. Here is my HTML file:
<div style="background-color: #161624; width: 100%; height: 20%; "></div>
<div style="background-color: #efece7; width: 100%; height: 60% "></div>
<div style="background-color: #161624; width: 100%; height: 20%; vertical-align: bottom; "></div>
<button id="changecolor">Change Color</button>
</div>
I want the changecolor button to change the background color where the height is set at 20% on both sides. View image description here
The transition should be from blue to black.