输入文本框中标题的轮廓颜色在谷歌浏览器中显示不同。底部边框线看起来不同。
<input type="text" title="Please fill out this field.">
所以我尝试了以下代码:
<span class="pseudo-tooltip-wrapper" data-title="please fill out this field...">
<input type='text' required></span>
示例.css
[data-title]:hover:after {
opacity: 1;
transition: all 0.1s ease 0.5s;
visibility: visible;
}
[data-title]:after {
content: attr(data-title);
background-color: rgb(217, 235, 217);
color: #111;
font-size: 150%;
position: absolute;
padding: 1px 5px 2px 5px;
bottom: -1.6em;
left: 100%;
white-space: nowrap;
/* box-shadow: 1px 1px 3px #222222; */
opacity: 0;
border: 1px solid #111111;
z-index: 99999;
visibility: hidden;
}
[data-title] {
position: relative;
}
.pseudo-tooltip-wrapper {
/*This causes the wrapping element to be the same size as what it contains.*/
display: inline-block;
}
所以现在它显示如下。当我根据需要创建字段时,将显示默认标题栏。
我们可以修复默认的标题栏边框,而不是这种方法。
请在stackbliz中找到代码:https://stackblitz.com/edit/angular-pa2lnu
如何实现这个问题。
最佳答案
您可以使用 Angular Material 输入表单字段,它们更简单、全面且具有装饰性。如果你找到了请告诉我 [此链接] ( https://material.angular.io/components/form-field/overview ) 有帮助
关于html - 自定义输入文本框的内置标题栏边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59085967/