console
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>梯形布局示例</title>
<style>
.trapezoid {
position: relative;
width: 100%;
height: 100px;
background-color: lightblue;
clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
display: flex;
justify-content: center;
align-items: center;
border-radious: 100px
}
.title {
position: absolute;
width: 100%; // 可根据需要调整宽度
text-align: center;
/* color: white; */
/* 用于显示占满宽度 */
background-color: rgba(255, 0, 0, 0.3);
}
</style>
</head>
<body>
<div class="trapezoid">
<div class="title">标题文字</div>
</div>
</body>
</html>