gpt4 book ai didi

html - extjs - 在网页上居中一个 formPanel

转载 作者:行者123 更新时间:2023-11-28 10:23:54 24 4
gpt4 key购买 nike

使用 extjs,我有一个固定宽度的 formPanel。我想在普通网页中将此表单居中,这样即使我最小化浏览器,表单也会出现在中心。我没有使用外部容器,只是一个带有 html/css 页面的简单表单面板。所以以下内容不适用于我的情况:

layout: {
type: 'vbox',
align: 'center',
pack: 'center'
},
items: [{
title: 'Centered Panel',
width: 200,
height: 200
}]

最佳答案

使用 flex = 1 的另外两个容器(左和右)并将布局更改为 hbox:

layout: {
type: 'hbox'
},
items: [{
xtype: 'container',
flex: 1
},{
title: 'Centered Panel',
width: 200,
height: 200
}, {
xtype: 'container',
flex: 1
}]

关于html - extjs - 在网页上居中一个 formPanel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23841964/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com