[英]How to color selectInput placeholder prompt in Shiny?
我想在SelectInput
框(Segment mIgration)中SelectInput
藍色的“ Choose”提示,以便它看起來與其他輸入框相似,但是失敗了。
這是我在UI部分中使用的代碼:
column(width=2,
selectInput(inputId = "SEG_MIG",
label = "Segment Migration",
choices =c("Choose"='', "ALL",
unique(sort(as.character(final_data$`SEG MIG`)))),
multiple = TRUE
))
這段代碼將左側兩個輸入框中的選定元素顯示為藍色
tags$style(type='text/css', ".selectize-input { font-size: 16px; line-height: 16px; color: blue;}
.selectize-dropdown { background: grey; color: white; font-size: 12px; line-height: 12px; }"),
我不確定我在這里錯過了什么。 任何建議,將不勝感激。
這是控制選項,項目和占位符樣式的CSS。
library(shiny)
css <- "
.selectize-dropdown-content .option {
color: blue;
}
.selectize-input .item {
color: red !important;
background-color: yellow !important;
}
::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: pink;
}
::-moz-placeholder { /* Firefox 19+ */
color: pink;
}
:-ms-input-placeholder { /* IE 10+ */
color: pink;
}
:-moz-placeholder { /* Firefox 18- */
color: pink;
}"
ui <- fluidPage(
tags$head(
tags$style(HTML(css))
),
column(width=2,
selectInput(inputId = "SEG_MIG",
label = "Segment Migration",
choices = c("Choose"='', "ALL", "AAA", "BBB"),
multiple = TRUE
)
)
)
server <- function(input, output) {}
shinyApp(ui, server)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.