答案 0 :(得分:2)
答案 1 :(得分:1)
为了获得最佳实践,您应该共享您的代码。从图像和问题,你可以这样做。
* {
box-sizing: border-box;
}
.heading {
color: #404C64;
font-weight: 700;
position: relative;
display: inline-block;
margin: 0;
padding-left: 10px;
padding-right: 10px;
line-height: 0.4;
}
.heading:after {
display: block;
width: 100%;
padding: 10px;
content: '';
position: absolute;
left: 0;
right: 0;
top: 100%;
background: #D9EEC3;
border-radius: 10px;
z-index: -1;
}

<h1 class="heading">Text here</h1>
&#13;
答案 2 :(得分:0)
<h1>Text Here</h1>
CSS:
h1 {
display: inline-block;
position: relative;
/* Adjust below values accordingly */
padding: 0 15px;
}
h1:after {
content: '';
display: block;
position: absolute;
z-index: -1;
width: 100%;
left: 0;
/* Adjust below values accordingly */
height: 20px;
margin-top: -15px;
background-color: lightgreen;
border-radius: 10px;
}