【问题标题】:Two buttons displayed when applying Dojo style to button将 Dojo 样式应用于按钮时显示的两个按钮
【发布时间】:2014-07-05 14:31:09
【问题描述】:

当我将 DOJO 样式应用于按钮时,DOJO 样式按钮与一个小的普通按钮一起显示,任何人都可以帮我解决这个问题。下面是完整的 HTML 代码。提前致谢。

<html>
<head>

<style type="text/css">
@import "http://o.aolcdn.com/dojo/1.2.0/dijit/themes/tundra/tundra.css";
</style>

<script>
    dojoConfig = {
        async : true,
        parseOnLoad : true
    }
</script>
<script
    src="http://ajax.googleapis.com/ajax/libs/dojo/1.9.2/dojo/dojo.js"
    data-dojo-config="async: true"></script>
<script>
    require([ "dojo/parser", "dijit/form/Button" ], function(parser) {
        parser.parse();
    });
</script>
</head>
<body class="tundra">
    <button dojoType="dijit.form.Button" type="button" />
    Greetings
    </button>
</body>

【问题讨论】:

    标签: html css button dojo styles


    【解决方案1】:

    我在这里注意到两件事:

    您关闭了两次按钮:

    <button dojoType="dijit.form.Button" type="button" />
        Greetings
    </button>
    

    看看第一行的结尾,你正在使用/&gt; 结束你的&lt;button&gt;,这意味着你也在关闭按钮。替换为:

    <button dojoType="dijit.form.Button" type="button">
        Greetings
    </button>
    

    我注意到的第二件事是您正在加载旧版本的 Tundra 主题。您使用的是 Dojo 1.9.2,但您使用的是 1.2.0 的 Tundra 主题。尝试通过以下方式替换您的样式表:

    http://ajax.googleapis.com/ajax/libs/dojo/1.9.2/dijit/themes/tundra/tundra.css
    

    【讨论】:

    • 非常感谢 Dimitri,样式表是问题所在。谢谢它的工作。
    猜你喜欢
    • 2013-05-03
    • 1970-01-01
    • 2014-12-12
    • 1970-01-01
    • 2021-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-30
    相关资源
    最近更新 更多