简体   繁体   English

如何从 MUI 文本字段中删除边框

[英]How to remove border from MUI text field

I have used Input field from Material UI.我使用了 Material UI 中的 Input 字段。 I want to remove the border from it.我想从中删除边框。 I have tried using border="none" but it didn't remove.我尝试过使用border="none" ,但没有删除。

Screenshot截屏

Change the variant prop to filled or standard变体道具更改为填充或标准

The more you can work with mui styling rather than override it with custom CSS, the happier you'll be long term.你越能使用mui 样式而不是用自定义 CSS 覆盖它,你就越快乐。

<TextField 
   variant="standard"
   InputProps={{
     disableUnderline: "true"
   }}
/>

This will solve the issue.这将解决问题。 However, the built-in padding changes once you do this;但是,一旦执行此操作,内置填充就会发生变化; use some css to set it according to your UI.使用一些 css 根据您的 UI 进行设置。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM