Why won't my JavaScript open this modal box?

后端 未结 4 444
没有蜡笔的小新
没有蜡笔的小新 2021-01-20 22:54

I\'m trying to call up a click element to open up a modal box, and i\'m unsure what I\'m doing wrong.

I\'ve done basic debugging, but I\'m still relatively new to this,

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-20 23:25

    #teal {
      height: 100px;
      width: 100px;
      background-color: red;
    

    }

    Block Level Elements like

    typically need to have their dimensions defined unless they are going to expand to their inner content. You need to define a height and width to the div inside the anchor tag in order to create a clickable area. Right now your button is essentially 0h x 0w.

    Additional tip: you can get rid of the

    inside the anchor and just apply display:block to it, as well as define the height and width. That will keep your HTML as simple as it needs to be.

提交回复
热议问题