[英]Remove inner padding border in Material UI Outlined Text Field
[英]How to remove the border in material ui autocomplete text field
<Autocomplete
style={{ width: "178px" }}
options={getCites()}
renderInput={(params) => (
<TextField
color="warning"
className={Styles.brandfont}
{...params}
label=""
placeholder="All Emirate"
variant="standard"
inputProps={{
disableUnderline: true,
...params.inputProps,
style: { fontSize: "1rem" },
underline: {
"&&&:before": {
borderBottom: "none",
},
"&&:after": {
borderBottom: "none",
},
},
}}
/>
)}
/>
這是我的代碼,我需要刪除文本字段中的底部邊框,我嘗試了很多方法都不起作用。 如果我嘗試安裝 mui make styles 它會顯示一些錯誤。 單獨使用 css 幫助解決這個問題。
Input 具有previousElementSibling
,它在input
的父級上設置邊框底部。
它是一個::before
偽元素。
你可以使用這個技巧。
.MuiInputBase-root::before {
border: none;
}
https://developer.mozilla.org/en-US/docs/Web/CSS/::before
https://developer.mozilla.org/zh-CN/docs/Web/API/Element/previousElementSibling
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.