skip to Main Content

Why click the button, it do not response?

my demo code:
https://codesandbox.io/s/gallant-knuth-kwf55c

I check my code, do not find the issue, please help with this.

3

Answers


  1. example

    add it’s like a function

    <button onClick={functionName()} >hi</button>
    
    Login or Signup to reply.
  2. The reason for that,
    as All elements are set using position:absolute content div is overlapping with header.

    Which results in hiding header for interaction. So when we are clicking click is actually being fired on content, not button (See below).

    enter image description here

    There are couple things we can do,

    • either remove position absolute from DIV
    • Calculate height of content so it doesn’t overlap with footer using CSS view-port units / calc function
    Login or Signup to reply.
  3. try to comment out id="content" div and id="footer" div.

    because they are over-laping on the button that’s why button is not clickable.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search