我有一个显示字符串的只读文本字段。该字符串应从文本字段的左侧开始。我想知道Vuetify中是否可以将字符串与文本字段的中心对齐?
更新
这是我的代码:
<v-text-field
value="Select the configuration:"
color="grey lighten-43"
class="text--darken-3 mt-3 text-xs-center"
outline
readonly
single-line
></v-text-field>
最佳答案
如果您使用的是作用域样式,则必须为输入字段使用一个深层选择器(即>>>
):
<v-text-field
class="centered-input text--darken-3 mt-3"
value="Select the configuration:"
color="grey lighten-43"
outline readonly single-line />
<style scoped>
.centered-input >>> input {
text-align: center
}
</style>
关于html - 在Vuetify中将文本对齐到文本字段的中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52742131/