html - 移除 button[type="submit"] 的嵌入阴影
问题描述
我希望按钮标签与链接相同
.btn {
border-radius: 2px;
padding: 18px 30px;
color: #fff;
/* ! */
max-height: 50px;
font-weight: 400;
font-size: 14px;
line-height: 100%;
box-shadow: none;
/* identical to box height, or 30px */
color: #fff;
transition: .05s;
text-transform: capitalize;
/* */
white-space: nowrap;
text-align: center;
webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn i,
.btn svg,
.btn span {
width: 24px;
font-size: 1.5em;
}
.btn-dark {
background: #3a3e46;
}
.btn-dark:hover {
background: #292c31;
}
<button class="btn btn-dark"> I'm a button </button>
<br><br><br><br><br>
<a class="btn btn-dark"> I'm a link </a>
不是字体,只有嵌入的阴影。
解决方案
您可以使用以下方法删除边框:
border: none;
.btn {
border-radius: 2px;
padding: 18px 30px;
color: #fff;
/* ! */
max-height: 50px;
font-weight: 400;
font-size: 14px;
line-height: 100%;
box-shadow: none;
/* identical to box height, or 30px */
color: #fff;
transition: .05s;
text-transform: capitalize;
/* */
white-space: nowrap;
text-align: center;
webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: none;
}
.btn i,
.btn svg,
.btn span {
width: 24px;
font-size: 1.5em;
}
.btn-dark {
background: #3a3e46;
}
.btn-dark:hover {
background: #292c31;
}
<button class="btn btn-dark"> I'm a button </button>
<br><br><br><br><br>
<a class="btn btn-dark"> I'm a link </a>
推荐阅读
- r-markdown - 当我从 Rmd 编织到 Word 时,数学方程没有呈现
- typescript - TypeScript:创建子类时未定义抽象类(对象原型可能仅为对象或null:未定义)
- flutter - 如何编辑“ListView”中项目的高度?
- spring-mvc - 如何在负载平衡期间跨 springmvc 应用程序的多个实例维护通过 ValueGenerator 在 JPA 实体中生成的唯一密钥
- azure - 由于防火墙,无法从 VM 到 Azure Blob 存储
- javascript - 如何验证输入是否包含javascript中数组项中的一个子字符串?
- php - Foreach 循环只返回第一个结果
- python - 在 OpenGL 中使用纹理数组对球体进行纹理处理
- python - 我很难理解这个数组索引的含义:img[0: lengthList[i], widthList[i]: widthList[i+1]] = outPut
- python - 错误 #15:正在初始化 libiomp5md.dll,但发现 libiomp5md.dll 已经初始化