Im trying to update our website, which was created in PYTHON, with FLET library. I want to position elements on my page. I want logo to be on the left, and form in the middle of the page, absolute-like alingment
I have tried something like that:
logo =ft.Image(
src="example/logo.png",
width=100,
height=100,
fit=ft.ImageFit.CONTAIN)
form_row = ft.Row(
controls=[query,submit],
alignment=ft.MainAxisAlignment.CENTER)
main_row = ft.Row(
controls=[logo, ft.Container(content=form_row, alignment=ft.alignment.center)],
alignment=ft.MainAxisAlignment.START,
vertical_alignment=ft.CrossAxisAlignment.CENTER,
)
page.add(main_row)
But all elements are glued to the left side
Im trying to update our website, which was created in PYTHON, with FLET library. I want to position elements on my page. I want logo to be on the left, and form in the middle of the page, absolute-like alingment
I have tried something like that:
logo =ft.Image(
src="example/logo.png",
width=100,
height=100,
fit=ft.ImageFit.CONTAIN)
form_row = ft.Row(
controls=[query,submit],
alignment=ft.MainAxisAlignment.CENTER)
main_row = ft.Row(
controls=[logo, ft.Container(content=form_row, alignment=ft.alignment.center)],
alignment=ft.MainAxisAlignment.START,
vertical_alignment=ft.CrossAxisAlignment.CENTER,
)
page.add(main_row)
But all elements are glued to the left side
Share Improve this question asked Mar 27 at 11:23 Jakub WójcickiJakub Wójcicki 1 2 |1 Answer
Reset to default 0Look, I didn't have a great experience with Flet my project didn't even get out of paper, but I think you can't position only one left because you put this command "alignment = ft.mainaxisalignment.start" no main_row ie "master" alignment is the main_row and the others will be ignored
DevTools
to see HTML and CSS - to see if they have correct values. You can also useDevTools
to test different values for CSS - to see what to change to get expected result. Frankly I would prefer to do it with pure HTML and CSS instead of flet or other modules which don't allow to control pure HTML and CSS. – furas Commented Mar 30 at 12:26minimal working code
which we could simply copy and test. – furas Commented Mar 30 at 12:27