我的表单使用一些基于用户文本输入的逻辑条件。我为条件编写了一个 JavaScript 函数,并决定在用户在文本字段中键入内容后点击按钮时执行此函数。当我在 Brackets.io 的实时预览中运行我的代码时,按钮是可见的。但是当我在网络上打开 .html 文件时,按钮不显示。
我尝试使用 <input>
使用 type="submit"使其成为一个按钮,但这也没有显示出来。
HTML:
<button id="funcCond">Proceed</button>
CSS:
button {
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -300%);
transform: translate(-50%, -300%);
display: block;
width: 70vw;
opacity: 0;
pointer-events: none;
transition: all 0.5s cubic-bezier(0.4, 0.25, 0.8, 0.3);
}
最佳答案
尝试:
<button type="submit" id="funcCond">proceed</button>
或者:
<input type="button" value="proceed"/>
..并确保将不透明度值修改为 1
关于javascript - HTML//CSS//JavaScript : button or input doesn't show up on web,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50537956/