[英]How can I use CSS or JS to make some text inputs display a help icon inside the input?
看下面的代碼。 更改border-width: 0 30px 30px 0;
的值border-width: 0 30px 30px 0;
更改三角形的大小,並更改text-indent:16px;
對齊問號。
.help{ position:relative; display:inline-block; } input{ padding:10px; } .help a:before{ content: "?"; position:absolute; top:0; right:0; display:block; width: 0; height: 0; border-style: solid; border-width: 0 30px 30px 0; border-color: transparent #007bff transparent transparent; text-align:right; text-indent:16px; color:#fff; }
<div class="help"> <input type="text" > <a href=""></a> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.