嘿家伙,我一直在尝试与我的 CSS 背景不同的东西,以制作标题行。我想设置它,使这条线由 5 个大小相等的部分组成,每个部分都是不同的颜色。这是一个示例 ,我设置了代码,但无法正确显示背景我的代码在下面。任何帮助将不胜感激,谢谢!
HTML:
<div id="div-line">
<div class="blockOne"></div>
<div class="blockTwo"></div>
<div class="blockThree"></div>
<div class="blockFour"></div>
<div class="blockFive"></div>
</div>
CSS:
#div-line {
width:100%;
height:5px;
}
.blockOne {
width:20%;
background-image:url(../images/orangeBlock.png);
background-repeat:repeat-x;
}
.blockTwo {
width:20%;
background-image:url(../images/blueBlock.png);
background-repeat:repeat-x;
}
.blockThree {
width:20%;
background-image:url(../images/darkOrangeBlock.png);
background-repeat:repeat-x;
}
.blockFour {
width:20%;
background-image:url(../images/orangeBlock.png);
background-repeat:repeat-x;
}
.blockFive {
width:20%;
background-image:url(../images/BlueBlock.png);
background-repeat:repeat-x;
}