简体   繁体   English

<Button>不能与弹出窗口一起使用。</button> <Button>(HTML,CSS,JS)</button>

[英]<Button> won't work with popup. (HTML, CSS, JS)

I can't quite figure this out. 我不太明白这一点。 I've created a smiley with css color values. 我用css颜色值创建了一个笑脸。 But when I added the button it made the face ugly. 但是当我添加按钮时,它的外观很难看。 (It added a circle around the center of the smiley design) I've tried forwarding the button tag with the same element of the popup which is popScroll . (它在笑脸设计的中心周围增加了一个圆圈)我尝试过将按钮标签与弹出窗口的相同元素popScroll But still my luck has yet to shine through. 但是我的运气还没有得到体现。

When I click the submit button in the bottom right, the popup will open and refresh, which is fine. 当我单击右下角的提交按钮时,弹出窗口将打开并刷新,这很好。 It shows it works, but I really want to get this smiley face I've made to work with this popup so I can move further with design. 它显示了它的工作原理,但是我真的很想得到我制作的带有此弹出窗口的笑脸,以便我可以进一步进行设计。

Can someone please show me what i'm doing wrong? 有人可以告诉我我在做什么错吗? I'm really new to this, and would love some insight on how to be a better coder and developer. 我真的很陌生,希望对如何成为一名更好的编码人员和开发人员有所了解。 When you click the button now(the smiley face) it will do a alert which says hi, I was just testing to see a transparent button over the face would work. 当您现在单击按钮(笑脸)时,它会发出警报,提示您好,我只是在测试是否可以看到透明按钮在脸上。

I'll be active to respond to any questions and responses immediately. 我将积极响应任何问题和回应。

My code can be found here . 我的代码可以在这里找到。

<div class="popScroll">
    <div class="popup"> 
    <!-- Smiley button -->
    <button onclick="alert('hi');" class="smiley">
        <!--<div class = "smiley"></i></div>-->
    </button>

Seems a border has been added higher up in the css. 似乎在CSS的上方添加了边框。

Remove this and you should be sorted. 删除它,您应该会被排序。

.smiley {
    border: none;
}

CodePen CodePen

这是你想要的?

.smiley:focus{ outline: none}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM