段落各行的背景色-Css

问题描述 投票:1回答:1

我正在尝试在标题行上添加背景色,但由于客户需要我做,所以无法使其完美。 我的客户需要这个完全相同:enter image description here并且在响应模式下,它应该看起来像:enter image description here我所做的是在文本中添加background-color,但这并不完美。enter image description hereenter image description here背景颜色从上到下散布,尝试了很多,但无法弄清楚。这是我的代码:

.sectionTitle {
    font-size: 58px;
    font-size: 3.0526315789rem;
    line-height: 56px;
    line-height: .9655172414;
    font-weight: bold;
    color: #233e57;
    text-align: center;
}
.sectionTitle span {
    background-color: #ffe2b3;
    display: inline;
}
<h1 class="sectionTitle"><span>What students are Saying?</span></h1>

请帮我解决这个问题。

html css
1个回答
0
投票

希望对您有帮助。

.sectionTitle {
  font-size: 58px;
  font-size: 3.0526315789rem;
  line-height: 56px;
  line-height: .9655172414;
  font-weight: bold;
  color: #233e57;
  text-align: center;
}

.sectionTitle span {
  display: inline;
  line-height: 0.2;
  padding: 0;
  background: url('https://i.ibb.co/QFNPT8G/bg.png');
  background-repeat: repeat;
  background-position-x: 0%;
  background-position-y: 0%;
  background-repeat: repeat-x;
  background-size: 30px 40px;
  background-position: center center;
}
<h1 class="sectionTitle"><span>What students are Saying?</span></h1>
© www.soinside.com 2019 - 2024. All rights reserved.