html - 使用 css 去除背景

标签 html css

这是创建按钮的html代码

  <div class="delete-style">
    <button type="button">DELETE</button>
  </div>

我正在使用这个 css 代码来移除 button 中文本周围的边框

.delete-style {
    background-color: red;
    padding: 10px 20px;
    text-decoration: none;
    display: inline-block;
    outline: None;
    overflow: hidden;
}

result

最佳答案

要删除按钮周围的边框,您可以将 border : None; 样式添加到您的按钮

.delete-style {
    background-color: red;
    padding: 10px 20px;
    text-decoration: none;
    display: inline-block;
    outline: None;
    overflow: hidden;
}
.delete-style button {
 border: None;
}
  <div class="delete-style">
    <button type="button">DELETE</button>
  </div>

关于html - 使用 css 去除背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50493660/

相关文章:

html - 行高和字体大小的变化导致内联 block 元素中出现间隙

php - 如何在PHP中获取 "words"之前或 "words"之后的字符串

php - 长图像名称破坏 CSS div

html - 如何将 View 中的脚本移动到 Ruby On Rails 中的单独 js 文件?

html - 100% 自定义输入宽度

javascript - 仅从 insideHTML 中删除文本

javascript - 根据 <img> 标签拆分 html 页面

CSS展开宽度

css - 防止前一个 div 调整大小时 div 向下移动

javascript - 提交表单并使用 href 标签在弹出窗口中打开它