我在bootstrap中有一个关闭(x)按钮,我无法使用javascript显示。一旦我给它的类名称close
它消失。是什么赋予了?无法获取Bootstrap关闭按钮以显示
var btn = document.createElement("button"); //<button> element
btn.className("close"); <!-- unless commented out it won't show -->
var t = document.createTextNode("x"); <!-- would rather use × but this will work for now -->
btn.setAttribute("class", "close"); <!-- tried this and didn't work either -->
cell4.appendChild(btn);
参考我想这一类从引导
button.close {
-webkit-appearance: none;
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
}
打开你的开发工具(点击F12)并检查元素。您将看到所有正在应用的CSS。这会告诉你你的问题在哪里。 –
什么是您的CSS代码(不是引导程序)? – crazymatt
我没有任何我自己的,我试图将自举代码应用到它。 – john