为甚么我的值显示图4?
.cr-bgimg{ width: 600px; height: 400px; position: absolute; overflow: hidden; left: 0; top:0; z-index: 1; background-repeat: no-repeat; } .cr-bgimg>div{ width: 150px; height: 100%; float: left; overflow: hidden; background-repeat: no-repeat; } .cr-bgimg div span{ width: 100%; height: 100%; position: absolute; left: 0; top:0; z-index: 2; text-indent: -9999px; } .cr-container input.cr-selector-img-1:checked ~ .cr-bgimg, .cr-bgimg div span:nth-child(1){ background-image: url(images/1.jpg); } .cr-container input.cr-selector-img-2:checked ~ .cr-bgimg, .cr-bgimg div span:nth-child(2){ background-image: url(images/2.jpg); } .cr-container input.cr-selector-img-3:checked ~ .cr-bgimg, .cr-bgimg div span:nth-child(3){ background-image: url(images/3.jpg); } .cr-container input.cr-selector-img-4:checked ~ .cr-bgimg, .cr-bgimg div span:nth-child(4){ background-image: url(images/4.jpg); }
正在回答 回答被采纳积分+1
<div class="clr"></div>
<div class="cr-bgimg">
<div>
<span>Slice 1- Image-1</span>
<span>Slice 1- Image-2</span>
<span>Slice 1- Image-3</span>
<span>Slice 1- Image-4</span>
</div>
<div>
<span>Slice 2- Image-1</span>
<span>Slice 2- Image-2</span>
<span>Slice 2- Image-3</span>
<span>Slice 2- Image-4</span>
</div>
<div>
<span>Slice 3- Image-1</span>
<span>Slice 3- Image-2</span>
<span>Slice 3- Image-3</span>
<span>Slice 3- Image-4</span>
</div>
<div>
<span>Slice 4- Image-1</span>
<span>Slice 4- Image-2</span>
<span>Slice 4- Image-3</span>
<span>Slice 4- Image-4</span>
</div>
</div>
</section>
</div>
</body>
</html>
这是html 只显示图4,
- 参与学习 1887 人
- 提交作业 4643 份
- 解答问题 5760 个
有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星