Clickable button on coloured background

How do you make a clickable button that is on a colored background in html/css,; would you use z-index for layer?

Not really.

body {
  background: red;
}

<button type="button">Click me!</button>

No need for z-index. That specifies the stack order of an element, but you are not stacking anything on anything.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.