admin管理员组文章数量:1394384
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
本文标签: pythonHow to align one control to the leftand center the rest in FLETStack Overflow
版权声明:本文标题:python - How to align one control to the left, and center the rest in FLET? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744093339a2589830.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
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