如何使actionButton及其标签变小,但仍居中于按钮图标?我已经能够使按钮和文本变得更小,但结果是一个小按钮和小文本没有居中。我想我可能是不正确地处理这个问题。这是一个按钮/文本变小的例子,但结果是一个文本没有居中的按钮。
library(shiny)
shinyApp(
shinyUI(fluidPage(
inputPanel(
## Original
actionButton('button', 'Hi'),
## Text is smaller
提到了一种使用“重影元素”在css中将元素垂直居中的技术。
/* This parent can be any width and height */
.block {
text-align: center;
/* May want to do this if there is risk the container may be narrower than the element inside */
white-space: nowrap;
}
/* The ghost, nudged to maintain perfect centering */
.block:before