利用浮动配合伪元素来实现,代码如下
<!DOCTYPE">
<html>
<head>
<title> New Document </title>
<meta charset="UTF-8">
<meta name="hsw">
<style>
#btn{
border: 0;
background-color: transparent;
outline: none;
/*去除button默认样式*/
display: block;
width: 100px;
height: 40px;
background-color: black;
text-align: center;
line-height:36px;
position: relative;
color: #FFF;
font-size: 1.6em;
margin: 0 auto;
}
#btn::before{
content: "";
width: 20px;
height: 20px;
border-radius: 20px;
background: #fff;
position: absolute;
display: block;
left: 88px;
top: 10px;
}
</style>
</head>
<body>
<button id="btn">button</button>
</body>
</html>