在R Shiny中更改navbarPage菜单栏的背景颜色 [英] Change background colour of navbarPage menubar in R shiny

查看:301
本文介绍了在R Shiny中更改navbarPage菜单栏的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在R Shiny中,我想更改导航栏菜单的背景颜色.我想将菜单栏上所有位置的颜色(包括悬停在按钮上或按钮处于非活动状态时的按钮的颜色)更改为一种颜色(黑色),但字体除外.但是,我不希望更改任何其他默认颜色,例如页面主要部分的背景颜色.我尝试通过如下创建CSS文件来实现此目的:

In R Shiny, I would like to change the background colour of the navbar menu. I would like to change the colour everywhere on the menu bar (including the colour of the buttons when hovering over them, or when they're inactive, etc.), except for the font, to one colour (black). However, I do not wish to change any other default colours, such as the background colour of the main part of the page. I've attempted to do so by creating a CSS file as follows:

body, 
#selector, 
.container, 
.navbar-background { background: #000000; }

我也尝试了许多其他组合和参数,但似乎没有任何效果.用于控制导航栏菜单栏背景颜色的CSS文件中的参数是什么?

I've also tried lots of other combinations and parameters, but nothing seems to work. What is the parameter in the CSS file that controls the background colour of the navbar menu bar?

请注意以下答案:如何在其中更改navBarPage标头背景Zebble吗?没为我工作.

Note that the answer in: How to change navBarPage header background in Zebble? hasn't worked for me.

推荐答案

尝试

.navbar-default {
    background-color: #b1b1b3 !important;
}

.navbar-default:hover {
    background-color: #aaaaaa !important;
    color: yellow;
}

这篇关于在R Shiny中更改navbarPage菜单栏的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆