HTML5 button 黑色边框怎么去除

1,257 阅读1分钟

在这里插入图片描述按钮有黑色边框很丑, 有时候会忘记怎么去除边框 代码如下:

* {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    label {
        margin: 0 5px;
    }
    
    input {
        height: 22px;
        outline: none;
    }
    
    button {
        width: 40px;
        height: 22px;
        line-height: 22px;
        margin-left: 10px;
        background-color: lightblue;
        border: none;
        color: #fff;
    }

加入这个就可以了 button{ border:none; } 不过不要忘记设置宽高 不然按钮会和文本框对不齐

效果图: 在这里插入图片描述

这样就可以了!