Html 按钮边框颜色问题

Html 按钮边框颜色问题,html,css,button,Html,Css,Button,我用下面的HTML和CSS代码创建了一个按钮 .btnstyle2{ 高度:28px; 文本对齐:居中; 背景色:#F8; 边界半径:3px; 边框颜色:#E8E8E8; } 取消您有一个起始样式,这是按钮中的默认样式(例如,插入输入)。 如果需要实心边框,请添加以下内容: border-style: solid; 您可以查看: .btnstyle2{ 高度:28px; 文本对齐:居中; 背景色:#F8; 边界半径:3px; 边框颜色:#E8E8E8; 边框样式:实心; } 解除按钮使用

我用下面的HTML和CSS代码创建了一个按钮

.btnstyle2{
高度:28px;
文本对齐:居中;
背景色:#F8;
边界半径:3px;
边框颜色:#E8E8E8;
}

取消
您有一个起始样式,这是按钮中的默认样式(例如,插入输入)。 如果需要实心边框,请添加以下内容:

 border-style: solid;
您可以查看:

.btnstyle2{
高度:28px;
文本对齐:居中;
背景色:#F8;
边界半径:3px;
边框颜色:#E8E8E8;
边框样式:实心;
}

解除
按钮使用默认样式。通过将边框设置为“实体”,将替代默认样式

您可以将宽度、样式和颜色的边框声明组合成一行,如下所示:

.btnstyle2{
高度:28px;
文本对齐:居中;
背景色:#F8;
边界半径:3px;
边框:2px实心#E8E8E8;
}
解除
将此用于边框。
边框:1px实心#e8e8e8

只需覆盖按钮默认类不需要的属性:

button {
    align-items: flex-start;
    text-align: center;
    cursor: default;
    color: buttontext;
    padding: 2px 6px 3px;
    border: 2px outset buttonface; /* bad */
    border-image-source: initial;
    border-image-slice: initial;
    border-image-width: initial;
    border-image-outset: initial;
    border-image-repeat: initial;
    background-color: buttonface;
    box-sizing: border-box;
}
示例:

.btnstyle2{
    height: 44px;
    width: 46px;
    text-align: center;
    border-radius: 3px;
    border-color: #E8E8E8;
    border: none; /* new here */
    background: url('https://www.linkedin.com/scds/common/u/images/logos/linkedin/logo_in_nav_44x36.png') left center no-repeat;
}
.btnstyle2{
   height: 28px;
   text-align: center;
   background-color: #F8F8F8;
   border:2px solid #E8E8E8;
   border-style:solid;
}
<button type="button" class="btnstyle2">Dismiss</button>

您可以使用
边框:
属性,而不是
边框颜色:
,该属性用于在
CSS中设置边框样式。您还可以在一行上编辑
边框颜色
边框样式
,如下图所示

CSS:

.btnstyle2{
    height: 44px;
    width: 46px;
    text-align: center;
    border-radius: 3px;
    border-color: #E8E8E8;
    border: none; /* new here */
    background: url('https://www.linkedin.com/scds/common/u/images/logos/linkedin/logo_in_nav_44x36.png') left center no-repeat;
}
.btnstyle2{
   height: 28px;
   text-align: center;
   background-color: #F8F8F8;
   border:2px solid #E8E8E8;
   border-style:solid;
}
<button type="button" class="btnstyle2">Dismiss</button>
HTML:

.btnstyle2{
    height: 44px;
    width: 46px;
    text-align: center;
    border-radius: 3px;
    border-color: #E8E8E8;
    border: none; /* new here */
    background: url('https://www.linkedin.com/scds/common/u/images/logos/linkedin/logo_in_nav_44x36.png') left center no-repeat;
}
.btnstyle2{
   height: 28px;
   text-align: center;
   background-color: #F8F8F8;
   border:2px solid #E8E8E8;
   border-style:solid;
}
<button type="button" class="btnstyle2">Dismiss</button>
驳回
请尝试以下方法:

Html


不是宽度,而是样式…:)取决于您想要1行还是2行(假设@MarcosPérezGude:)很高兴帮助@Parkerwillams。您可以这样说:
您需要定义按钮边框的宽度。
这不是真的,是样式。您可以内联、独立或随意放置,但宽度不是问题;)@现在你的答案更好了;)我比你高