简体   繁体   English

如何更改材质 ui TextField 的 label 标高?

[英]How can I change the label elevation of a material ui TextField?

I want to elevate the label of a textfield but I cant, this is my code.我想提升文本字段的 label 但我不能,这是我的代码。

  textStyle: {
    backgroundColor: '#1c1a1a',
    border: 0,
    borderRadius: 0,
    width: 400,
    height: 66,
    display: 'flex',
    justifyContent: 'center',
    alignItems: 'center',
    marginBottom: 10,
    padding: '0 10px',
    '& .MuiFormLabel-root': {
      color: 'grey',
      padding: '1px',
      height:'10px',
    },
  },

height does nothing, how can I elevate the label?高度什么都不做,我怎样才能提升 label?

Add this field to your textStyle :将此字段添加到您的textStyle

marginTop: -10

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更改材质 ui TextField 的 label 大小? - How can I change the label size of a material ui TextField? 如何在反应中更改 material-ui 文本字段标签样式 - How to change material-ui Textfield label styles in react 在Material-UI TextField中,当输入模糊时,如何防止标签落在装饰物后面? - In a Material-UI TextField how can I prevent a label from falling behind an adornment when the input is blurred? 如何在错误和焦点上更改 Material-UI TextField 底部和标签颜色 - How to change Material-UI TextField bottom and label color on error and on focus 如何在 Material Ui 的 TextField 中更改日历的主题 - How to change theme of calendar in TextField in Material Ui 如何根据 TextField 的值以编程方式更新 Material UI TextField 的 helperText? - How can I programmatically update the helperText of a Material UI TextField based on the value of the TextField? 如何更改滑块(材质 ui)中标签的值? - how to change the value of label in slider (material ui)? 反应材料ui文本字段类型号如何在更改时保存小数 - React material ui textfield type number how to save decimal on change Material-UI | 如何更改禁用文本字段的颜色? - Material-UI | How to change the colour of a disabled textfield? 如何在 Material UI 中为 Textfield 类型日期设置“min”属性? - How can I set 'min' attribute for a Textfield type date in Material UI?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM