簡體   English   中英

通過 hover 關於文本字段如何去除黑色邊框

[英]by hover on the text field how to remove the black border

當我們想在文本字段上顯示 hover 時,文本字段中出現一些黑色邊框,如何解決該問題

import React, { useState } from "react";
import TextField from '@mui/material/TextField';
import { styled } from '@mui/material/styles';
const styles = styled(TextField)({
  '*.Mui-focused': {
    borderColor: 'transparent',
    outline:'none',
  }})
export default function Demo() {
  return (
    <>
      <TextField id="standard-basic" label="Standard" variant="standard"  />
    </>
  );
}

您可以添加此樣式以在懸停時設置新顏色

'&:hover fieldset': {
      borderColor: 'grey',
    },

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM