Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何定义shinydashboard开始包装元素和隐藏边栏的屏幕宽度?_Css_R_Shiny_Shinydashboard - Fatal编程技术网

Css 如何定义shinydashboard开始包装元素和隐藏边栏的屏幕宽度?

Css 如何定义shinydashboard开始包装元素和隐藏边栏的屏幕宽度?,css,r,shiny,shinydashboard,Css,R,Shiny,Shinydashboard,Shinydashboard有一个反应灵敏的布局,当缩小屏幕宽度时,它会在某一点开始堆叠元素。我想知道是否以及如何定义这一点,因为默认设置不适合我的布局 下面的示例说明了该问题。在响应性布局决定隐藏侧栏和堆叠UI元素之前,内容元素被压缩到超出优雅和有用的程度 我想这与默认设置有关。我通过此解决方案解决了此类问题: ui <- tagList( tags$style("html,body{background-color: white;} .c

Shinydashboard有一个反应灵敏的布局,当缩小屏幕宽度时,它会在某一点开始堆叠元素。我想知道是否以及如何定义这一点,因为默认设置不适合我的布局

下面的示例说明了该问题。在响应性布局决定隐藏侧栏和堆叠UI元素之前,内容元素被压缩到超出优雅和有用的程度


我想这与默认设置有关。

我通过此解决方案解决了此类问题:

ui <- tagList(
  tags$style("html,body{background-color: white;}
                .container{
                    width: 100%;
                    margin: 0 auto;
                    padding: 0;
                }
               @media screen and (min-width: 700px){
                .container{
                    min-width: 1850px;
                    max-width: 1920px;
                }
               }
             "),
tags$div(class="container",
  dashboardPage( title="min and max width"
    ,dashboardHeader(title = p("app header") )
    ,dashboardSidebar(
    )
    ,dashboardBody(
      tags$head(
        tags$style(
          "
          body{
              height: auto;
              margin: auto;
              overflow-x: auto;
          }"
        )
    ) # head
    ) # dashboardbody
  )
)
)
server<- function(input, output, session) {}

shinyApp(ui,server)

ui它与默认css中的
@media
查询有关。您知道我是否可以以及如何改变这种行为吗?可以,我刚才做过(根本不希望崩溃发生)。您需要添加自定义CSS文件,以适应@media标记。也许看看这个答案:我明白了,这很有帮助。这让我想到了这一点:。目前,Shiny和Shinydashboard与bootstrap 3.3配合使用,所以我想这是最好的选择。不幸的是,这些解决方案并不适用。我猜闪亮层隐藏了引导类?我没能找到一个令人满意的解决方案来解决这个问题,结果固定了某些屏幕宽度的页面宽度:
@media(最大宽度:888px)和(最小宽度:768px){site{width:888px;}