Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/422.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Webiopi多按钮css_Javascript_Jquery_Html_Css_Webiopi - Fatal编程技术网

Javascript Webiopi多按钮css

Javascript Webiopi多按钮css,javascript,jquery,html,css,webiopi,Javascript,Jquery,Html,Css,Webiopi,我想用不同的颜色来改变按钮的背景色,但最终会在button和.bd中出现重叠css Javascript: var restart = webiopi().createMacroButton("macro", "restart", "myMacroWithoutArgs1"); $("#restart").append(restart); var shutdown = webiopi().createMacroButton("macro", "sh

我想用不同的颜色来改变按钮的背景色,但最终会在button和.bd中出现重叠css

Javascript:

var restart = webiopi().createMacroButton("macro", "restart", "myMacroWithoutArgs1");
            $("#restart").append(restart);
            var shutdown = webiopi().createMacroButton("macro", "shutdown", "myMacroWithoutArgs2");
            $("#shutdown").append(shutdown);
            var schedule_set = webiopi().createMacroButton("debug", "debug");
            $("#debug").append(schedule_set);
            var back = webiopi().createMacroButton("back", "หน้าหลัก");
            $("#back").append(back);
CSS:

HTML:

希望有人能告诉我如何妥善解决这个问题?
谢谢

请看看这篇文章,里面有你要找的代码
我在一个div上堆叠了控件。

我对css的了解是,最新加载的css覆盖了以前加载的css。是的,应该是这样,但我不知道为什么在这种情况下它没有覆盖。我是否错过了html中的某些内容?您是否尝试过在html中添加新类并对其应用样式?e、 我的班级,然后。我的班级。按钮风格?是的,我尝试过,但它仍然有旧的风格重叠新的。不确定它是否与javascript中创建webiopi函数的按钮有关?
    <style type="text/css">
             button {
                    display: block;
                    margin: 5px 5px 5px 5px;
                    width: 160px;
                    height: 45px;
                    font-size: 24pt;
                    font-weight: bold;
                    color: white;
            }
            .bd{
            display: block;
                    margin: 5px 5px 5px 5px;
                    width: 160px;
            height: 45px;
            font-size: 24pt;
            font-weight: bold;
            box-shadow: 3px 4px 0px 0px #1564ad;
            background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #378de5));
            background:-moz-linear-gradient(top, #79bbff 5%, #378de5 100%);
            background:-webkit-linear-gradient(top, #79bbff 5%, #378de5 100%);
            background:-o-linear-gradient(top, #79bbff 5%, #378de5 100%);
            background:-ms-linear-gradient(top, #79bbff 5%, #378de5 100%);
            background:linear-gradient(to bottom, #79bbff 5%, #378de5 100%);
            background-color:#666666;
            }
    </style>
<div id="debug"
onClick="self.location='debug.html'">
</div>
<div id="restart"></div>
<div class="bd" id="shutdown"></div>
<div id="back"
onClick="self.location='index.html'">
</div>