I have this example app:
library(shiny)
ui <- fluidPage(
textInput("a", "A", width = 20),
textInput("b", "B", width = 20),
tags$img(
src = "https://posit.co/wp-content/uploads/2022/10/09_HOMEPAGE.svg",
style = 'position: absolute'
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
How can I position the textInput widgets like this way:
CodePudding user response:
You can change the order to have the image first then embed the input in a div
with absolute position:
ui <- fluidPage(
tags$img(
src = "https://posit.co/wp-content/uploads/2022/10/09_HOMEPAGE.svg",
style = 'position: absolute'
),
tags$div(
textInput("a", "A", width = 20),
style = 'position: absolute;left: 420px; top: 100px;'),
)