如何居中对齐 headerText?

How to align headerText in center?

从下面的代码片段中,如何将 headerText "Input" 居中对齐?

<List
        headerText="Input">
        <InputListItem label="Price (EUR)">
            <Input
                placeholder="Price"
                value="799"
                type="Number" />
        </InputListItem>
</List>

然而,我尝试了 textAlign="Center" 但这并没有做出任何改变。

但是当我检查元素并添加 align="center"(只是为了测试)时,显然它确实发生了变化,那么如何在代码片段中实现相同的效果?

抱歉这个菜鸟问题,搜索了很多但找不到任何解决方案!!

  1. 在 mvc:View 中添加 html 命名空间,如 <mvc:View xmlns:html="http://www.w3.org/1999/xhtml">
  2. <html:style>.test > header { text-align:center; }</html:style> 一样将 css class 添加到您的视图中。 test是你定义的class,你会在第3步添加,而>header是你的子节点选择器(你的headerText="Input"创建一个header节点)
  3. 将 class 测试添加到您的列表中,例如 < List class="test" headerText="Input">...</List>