<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
.test {
width: 100px;
height: 50px;
background-color: #00f;
margin: 0px 25px;
position: relative;
}
.test:before {
content: "";
display: block;
position: absolute;
width: 0px;
height: 0px;
top: 0;
left: -25px;
border: 25px solid transparent;
border-top-color: #00f;
border-bottom-color: #00f;
}
.test:after {
content: "";
display: block;
position: absolute;
width: 0px;
height: 0px;
top: 0;
left: 100%;
border: 25px solid transparent;
border-left-color: #00f;
}
</style>
</head>
<body>
<div class="test"></div>
</body>
</html>
应该可以,等下我试试
https://blog.csdn.net/qq_26388781/article/details/112603469?spm=1001.2014.3001.5501
看看我的
可以,伪元素
https://www.jb51.net/css/734268.html
您好,我是有问必答小助手,你的问题已经有小伙伴为您解答了问题,您看下是否解决了您的问题,可以追评进行沟通哦~
如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~
ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632