Home > Back-end >  How to overwrite AutoComplete Style property
How to overwrite AutoComplete Style property

Time:07-13

MuiInput-formControl {
    margin-top: 16px;

How can I overwrite the property to have marginTop = 0

I tried the below method but it did not work.

MuiFormControlLabel: {
      marginTop: 0,
    },
<Autocomplete
                  disablePortal
                  classes={{ root: classes.MuiFormControlLabel }}
>

CodePudding user response:

Put a dash "-" between Margin and top and it should work

Like:

MuiFormControlLabel: {
  margin-Top: 0,
},

CodePudding user response:

I think in your Autocomplete, you should use className instead of classes, I revise the code you can try.

    MuiFormControlLabel: {
      marginTop: 0
    }

<Autocomplete
 disablePortal
 className={classes.MuiFormControlLabel}
>

CodePudding user response:

You can try media query

@media all and (max-height: 10px)
     MuiInput-formControl{
          Margin-top: 0;}

The code in () is a condition, you can change it as per your need

  • Related