我必须达到这样的目标:
我决定将 ol 与背景图像一起使用。
这是我的html和css:
//html
<ol>
<li class="step1">
<p>Text Text TextTextTextTextText TextTextTextTextTextText
TextTextTextTextTextTextTextText TextTextTextTextTextTextText </p>
</li>
<li class="step2">
<p>Text Text TextTextTextTextText TextTextTextTextTextText
TextTextTextTextTextTextTextText TextTextTextTextTextTextText </p>
</li>
<li class="step3">
<p>Text Text TextTextTextTextText TextTextTextTextTextText
TextTextTextTextTextTextTextText TextTextTextTextTextTextText </p>
</li>
</ol>
//CSS
ol {
list-style-position: inside;
list-style: none;
font-size: 25px;
}
ol li {
background-image: url(../images/poga_zala_fons.png), url(../images/Nr1.png);
background-position: -5px 0, -5px 0;
background-repeat: no-repeat;
padding-left: 7px;
}
ol li.step1 p {
background-color: #99cc33;
margin-left: 10px;
z-index: -1;
}
ol li.step2 p {
background-color: #ffff99;
}
ol li.step3 p {
background-color: #ffcc00;
}
ol li p {
font-size: 12px;
}
1)有很多问题,但第一个是我不能让ol的背景图像超过段落背景的背景图像。
2)其次,我不确定使用 ol/li 的想法是最好的,也许还有其他一些很好的建议可以更好地实现图像思考?请给我一些线索,我不是在问确切的解决方案。
我是 php 程序员,但对创建 CSS 设计很陌生。