提问者:小点点

如何保持按钮边框显示和点击其他区域后边框消失


就像对文档的影响一样,但它是一个a-tag,必须使用href属性。 我有两个问题1.对于伪类a-tag充当按钮,我如何防止它跳转到#block。 2.如果我使用button类,第一次点击它之后,如何让它保持在对焦状态,然后第二次点击之后,它又回到原来的状态……

.btn,.btn-primary{
    width: 110px;
    font-size: 0.9em;
    color: black !important;
    background-color: white !important;
}

.btn,.btn-primary:active,.btn,.btn-primary:focus{
    font-weight: bold;
    background-color:white;
    color:black;
    border-color:#4477b1 !important;
    border-width: 2px !important;
}

这是我的HTML:

<button type="button" class="btn btn-primary ml-4 active" data-toggle="button" aria-pressed="true" (click)=display()>{{buttonContent}}</button>

这张图显示了首次点击之后首次点击之后


共1个答案

匿名用户

请检查cssoutline属性。