1

我正在尝试将 adijit/layout/TabContainer与修改后的 dijit 主题一起使用。我需要修改选项卡的一些样式,TabContainer例如选项卡的填充、粗体等。但是,特定于使用的页面的样式命令TabContainer不起作用。

这段代码在我主页的 CSS 文件中。

.myTheme .homeTabContent
{
    font-weight: bold !important;
}

.myTheme .homeTabContent .dijitTab /* The .dijitTab is the original CSS class of the tab*/
{
    font-weight: bold !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
}

尽管!important. 编辑TabContainerCSS 文件myTheme不是一个实用的解决方案,因为我只会弄乱不同页面的样式。发生的情况是,当我加载带有样式的页面时,我的命令似乎正在工作一瞬间,但是当TabContainer完成加载时,所有这些都被撤消了。谁能告诉我为什么或给我一个解决方案?提前致谢!

4

1 回答 1

1

Here is a working solution. http://jsfiddle.net/oamiamgod/rd58M/

I have included class myTheme to body tag. Like this

<body class="claro myTheme">

I'm not good at english but I will try to explain.

If you write css like this .myTheme .homeTabContent .dijitTab that mean an element of class homeTabContent have to stay inside some element that has class myTheme

Like this

<body class="claro myTheme">
    <div class="homeTabContent">
        <div class="dijitTab"></div>
    </div>
</body>

But if you write css like this .myTheme.homeTabContent.dijitTab (with no space) it will be

<div class="myTheme homeTabContent dijitTab"></div>
于 2012-12-07T07:36:50.380 回答