html{
box-sizing: border-box;
font-size: 100%;
}
*,
*::before,
*::after{
margin: 0;
padding: 0;
box-sizing: inherit;
}
.div{
position: absolute;
top: 50%;
left: 50%;
background-color: hsla(0, 100%, 50%, 0.151);
transform: translate(-50%,-50%);
padding: 10px 40px;
}
.div::after{
content: '';
position: absolute;
top: 0;
left: 0;
width: 10px;
height: 10px;
border-left: 1px solid red;
border-top: 1px solid red;
border-radius: 3px 0px 0px 0px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/style.css">
<title>Document</title>
</head>
<body>
<div class="div">
<p>hello</p>
</div>
</body>
</html>
我试图用相同的边界半径属性将div设计的伪元素添加到div的所有四个侧面,但似乎只能使用::After和::Being将伪元素添加到两个侧面.