麻烦老师检查 是否有需要修改的地方
来源:2-21 自由编程
dww1
2021-10-21 01:00:25
<style> *{ margin: 0; padding: 0; } /* 第一种 */ div{ width: 88px; height: 81px; } img{ width: 88px; height: 81px; } .box{ position: relative; margin: 100px auto; } .box1{ position: absolute; top: 0; left: 0; animation: td 1s linear 0s infinite; } @keyframes td{ from{ opacity: 1; } to{ opacity: 0; transform: scale(3); } } /* 第二种 */ div{ width: 88px; height: 81px; } .out,.in{ background-image: url(images/xin.png); } .out{ margin: 100px auto; } .in{ animation: xt 1s linear 0s infinite; opacity:1; } @keyframes xt{ from{ opacity: 1; } to{ opacity: 0; transform:scale(3); } } </style>
<!-- 第一种 --> <div class="box"> <img src="images/xin.png" alt=""> <div class="box1"> <img src="images/xin.png" alt=""> </div> </div> <!-- 第二种 --> <div class="out"> <div class="in"></div> </div>
1回答
好帮手慕小李
2021-10-21
同学你好,作业完成的不错,撒欢儿~。
优化建议:
1、背景色的url路径这里要加引号,虽然这么写不报错,但建议按照w3c标准来,这样避免在不知名浏览器中会有bug。
2、img src后面的路径这么写也没错,但建议用 ./images/xin.png 这样写,因为之后的课程中层级目录会增多,所以建议同学,在学习初期尽量多加练习相对路径。
祝学习愉快~
相似问题