javascript - 在按钮 Angular 上打勾

标签 javascript html css

我想在右上角的按钮上打勾。我将输入值设置为它给我一个带有刻度标记的按钮文本,我希望它应该放在右上角。

.buttoner{
     	      background-color: #4CAF50;
              border: none;
              cursor: pointer;
              height: 48px;
              border-radius: 5px;
              width: 10%;
        }
     <input type="button" class="buttoner" value="buttoner&#10003"/></input>

我想要这样:

I want like this

最佳答案

enter image description here

.my-btn {
position: relative;
display: inline-block;
}
.buttoner {
background-color: #66bb6a;
border: none;
cursor: pointer;
height: 48px;
border-radius: 3px;
width: 120px;
text-align: center;
color: white;
line-height: 48px;
font-size: 14px;
font-weight: bold;
}
.my-btn .fa-check {
position: absolute;
top: 5px;
right: 10px;
color: #fff;
font-weight: normal;
}
<!DOCTYPE html>
<html>
<head>
<title>Button with tick mark</title>
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="my-btn">
<input type="button" class="buttoner" value="Button"/>
<i class="fa fa-check"></i> </div>
</body>
</html>

关于javascript - 在按钮 Angular 上打勾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57832142/

相关文章:

javascript - 使用 JQuery 构建 Tabs,最高效有效的方法?

javascript - 如何使用 javascript 或 jquery 在下拉列表中获取自定义属性的值

css - HTML5 Canvas 大小和分辨率

javascript - 如何使用包含凭据的提取和 POST 请求发送数据?

javascript - 提交表单而不刷新页面

javascript - 可排序列表重叠并防止拖放

css - grid-area 似乎不适用于 attr 函数,这是设计使然吗?

javascript - 表单验证不验证

html - 输入字段未在表单内联或表单水平对齐

javascript - 如何像预加载器一样实现 Youtube