覆盖 CSS 样式很简单:您创建一个自定义 CSS 样式表并将其包含在具体化 CSS 样式表之后。然后你找出Materialize 设置的规则,并覆盖它们。
例如,输入字段下方的边框由 MaterializeCSS 设计,如下所示:
input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=time], input[type=date], input[type=datetime], input[type=datetime-local], input[type=tel], input[type=number], input[type=search], textarea.materialize-textarea {
background-color: transparent;
border: none;
border-bottom: 1px solid #9e9e9e;
border-radius: 0;
outline: none;
height: 3rem;
width: 100%;
font-size: 1rem;
margin: 0 0 20px 0;
padding: 0;
box-shadow: none;
box-sizing: content-box;
transition: all 0.3s;
}
Run Code Online (Sandbox Code Playgroud)
要删除border-bottom,请在自定义 CSS 表中设置以下规则:
input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=time], input[type=date], input[type=datetime], input[type=datetime-local], input[type=tel], input[type=number], input[type=search], textarea.materialize-textarea {
border-bottom: none;
}
Run Code Online (Sandbox Code Playgroud)
禁用 JS 函数比较困难,您必须更改源 JS 代码并删除您不喜欢的函数。