css - 如何更改 xPage 上的整个导航栏背景颜色?

标签 css twitter-bootstrap xpages

这是我的 xPage,只有导航栏:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
    xmlns:xe="http://www.ibm.com/xsp/coreex">

    <xe:navbar id="navbarBottom" 
    fixed="fixed-bottom" 
    headingStyle="font-weight: bold;" 
    pageWidth="fixed" 
    headingText="Testpage" 
    title="Testpage"
    style="background-color:red;">

    <xe:this.navbarAfterLinks>
        <xe:basicLeafNode title="Page1" label="Page1" href="/Page1.xsp"></xe:basicLeafNode>
        <xe:basicLeafNode title="Page2" label="Page2" href="/Page2.xsp"></xe:basicLeafNode>
        <xe:basicLeafNode title="Page3" label="Page3" href="/Page1.xsp"></xe:basicLeafNode>
    </xe:this.navbarAfterLinks>
    </xe:navbar>
</xp:view>

我想改变它的背景颜色。但是 style="background-color:red;"仅适用于 After 链接。我无法真正弄清楚我应该将样式应用到哪个元素。检查元素,例如Chrome 让我感到困惑。

enter image description here

最佳答案

试试这个,它应该可以解决你的问题:

XPage

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">

    <xp:this.resources>
        <xp:styleSheet href="/custom.css"></xp:styleSheet>
    </xp:this.resources>

    <xe:navbar id="navbarBottom" fixed="fixed-bottom"
        headingStyle="font-weight: bold;" pageWidth="fixed" headingText="Testpage"
        title="Testpage" styleClass="navbar-custom">

        <xe:this.navbarAfterLinks>
            <xe:basicLeafNode title="Page1" label="Page1" href="/Page1.xsp">
            </xe:basicLeafNode>
            <xe:basicLeafNode title="Page2" label="Page2" href="/Page2.xsp">
            </xe:basicLeafNode>
            <xe:basicLeafNode title="Page3" label="Page3" href="/Page1.xsp">
            </xe:basicLeafNode>
        </xe:this.navbarAfterLinks>
    </xe:navbar>

</xp:view>

CSS 文件

.navbar-custom {
    background-color:red;
    background-image: none;
}

关于css - 如何更改 xPage 上的整个导航栏背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42705637/

相关文章:

css - firefox 和 IE 中的 ul 样式

javascript - 修改图像SRC并附加到Div

javascript - 为什么visible(render)属性的默认值会覆盖我在Xpages中设置的值

jquery - 水平和垂直居中模态对话框

html - 为什么在我使用 semantic-ui 时外部 CSS 文件不起作用?

html - 我想要一个靠近另一个 div 的 div

html - 将行放在容器底部

javascript - 如何在页面中存储 IBM Notes 数据库对象变量并稍后访问它

java - 如何消除同时访问 Notes 文档的可能性

html - 列表项下的样式跨度类