今天,我的HTML组件中的关闭按钮遇到了一个奇怪的问题。即,当我打开组件(客户的详细信息按钮)时,开始时的关闭按钮被蓝色边框包围。单击组件上的任意位置后,边框消失。 问题如下图所示:
我试图在我的CSS类中设置该选项,如outline:没有,但是没有带来令人满意的结果。而且,当我将复制相同的组件时:
undefined reference to vtable
只有第一个关闭按钮带有蓝色边框。
Customer-details.coponent.html
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"(click)="onClose()">
<span aria-hidden="true">×</span>
</button>
<button type="button" class="close" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
我要做的就是在打开组件后没有出现这个蓝色边框。我不确定我的浏览器是否有问题,但是目前我正在使用google chrome。感谢您提出建议以达到理想效果。
答案 0 :(得分:2)
向您遇到问题的div添加style =“ outline:none”。
如果是按钮,您可以这样
按钮:聚焦{outline:none;}
b = abs(b)
答案 1 :(得分:1)
要解决此问题,请在CSS下方使用此按钮来解决由于默认按钮焦点样式引起的蓝色边框线,请参考此链接-What is the default style of the blue focus outline in Chrome?
CSS可以解决此问题:
button:focus {
outline: 0;
}
答案 2 :(得分:1)
避免此类问题的一种好方法是重置CSS:https://meyerweb.com/eric/tools/css/reset/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}