如何找到闪亮的应用程序现有的CSS? [英] How do I find my shiny app's existing css?

查看:69
本文介绍了如何找到闪亮的应用程序现有的CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对CSS非常陌生,所以也许我问错了一个问题,但是当我使用navbarPage时,是否要将CSS添加到我的Web应用程序中?当我添加自己的CSS来添加一些文本和背景颜色时...

 < STYLE TYPE ='text / css '> 
/ *在csscreator.com上生成的CSS * /
BODY {background-color:#36454f; }
P {color:#999999; }
< / STYLE>

...它删除了导航栏,我的标签现在只是我的主标题下方的超链接。为什么是这样?



ui.R

 库(发光)

ShinyUI(navbarPage( main title,theme = www / my_css.css,
tabPanel( Dashboard,
plotOutput( plot1,width = 1600px),
plotOutput( plot2,width = 1600px),
plotOutput( plot3,width = 1600px),
actionButton( refresh,立即刷新)) ,
tabPanel( About,p( test))


有没有办法查看从生产的应用程序创建的CSS?

解决方案

如何访问Shiny应用程序的CSS?



这可能不是最好的方法,但我的方法(在Chrome版本41.0.2272.101上)是通过右键单击页面,然后单击查看页面源代码选项。打开新标签后,您会看到它是与您的Shiny应用相对应的HTML文件。此HTML文件的顶部包含以下语句中对应用程序中使用的CSS文件的引用:

 < link href = shared /datepicker/css/datepicker.css rel = stylesheet /> 

单击共享/ ...路径,您将能够看到CSS文件



添加自定义CSS



我会老实说,我没有尝试这样做,但是本文可能提供一些见识。 / p>

I am very new to css so perhaps I am asking the wrong question but when I use navbarPage am I adding css to my web app? When I add my own css for adding just some text and background color...

    <STYLE TYPE='text/css'>
/* CSS generated at csscreator.com */
BODY{background-color:#36454f; }
P{color:#999999; }
</STYLE>

...it removed the Navbar and my tabs are now just hyperlinks below my main title. Why is this?

ui.R

    library(shiny)

shinyUI(navbarPage("main title", theme = "www/my_css.css",
  tabPanel("Dashboard",
          plotOutput("plot1",       width = "1600px"),
          plotOutput("plot2",       width = "1600px"),
          plotOutput("plot3", width = "1600px"),
          actionButton("refresh", "Refresh now")),
  tabPanel("About" , p("test"))
    )  
  )

Is there a way to see the css that is created from the produced app?

解决方案

How do I access a Shiny app's CSS?

This may not be the best way, but the way I do it (on Chrome Version 41.0.2272.101) is by right clicking the page and clicking the "View page source" option. Once the new tab opens up, you can see it's an HTML file corresponding to your Shiny app. The top of this HTML file contains references to CSS files used in the app within statements like:

<link href="shared/datepicker/css/datepicker.css" rel="stylesheet" />

Click the "shared/..." path and you'll be able to see the CSS file

Adding custom CSS

I'll be honest I haven't tried doing this, but this article may offer some insight.

这篇关于如何找到闪亮的应用程序现有的CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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