How to position two images next to each other? #485
-
The code from nicegui import ui
with ui.row():
ui.image("https://picsum.photos/id/377/640/360")
ui.button("Button 1")
ui.button("Button 2")
ui.button("Button 3")
ui.image("https://picsum.photos/id/377/640/360")
ui.run() does not, as would one expect, position all theese elements next to each other, but always forces a line break for images: Is this behaviour intended? Is it a technical limitation? If not, how to position two images next to each other? |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Mar 9, 2023
Replies: 1 comment 2 replies
-
You can add the class "no-wrap" to the row. Because images get their size automatically from the surrounding container, we either need to give the row or the images themselves a width or height: with ui.row().classes('no-wrap'):
ui.image("https://picsum.photos/id/377/640/360").classes('w-60')
ui.button("Button 1")
ui.button("Button 2")
ui.button("Button 3")
ui.image("https://picsum.photos/id/377/640/360").classes('w-60') |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
wielandb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can add the class "no-wrap" to the row. Because images get their size automatically from the surrounding container, we either need to give the row or the images themselves a width or height: