试一试

.styled {

border: 0;

line-height: 2.5;

padding: 0 20px;

font-size: 1rem;

text-align: center;

color: white;

text-shadow: 1px 1px 1px black;

border-radius: 10px;

background-color: tomato;

background-image: linear-gradient(

to top left,

rgb(0 0 0 / 0.2),

rgb(0 0 0 / 0.2) 30%,

transparent

);

box-shadow:

inset 2px 2px 3px rgb(255 255 255 / 0.6),

inset -2px -2px 3px rgb(0 0 0 / 0.6);

}

.styled:hover {

background-color: red;

}

.styled:active {

box-shadow:

inset -2px -2px 3px rgb(255 255 255 / 0.6),

inset 2px 2px 3px rgb(0 0 0 / 0.6);

}

属性

此元素的属性包括全局属性。

autofocus

此布尔属性指定页面加载时按钮应具有输入焦点。文档中只能有一个元素具有此属性。

command

指定通过 commandfor 属性指定的控制