Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
<ol>
<!-- 用PHP foreach 演绎数组遍历 -->
<!-- 这里用PHP模范语法, : 相当于"{ " , endforeach 相当于 "}" -->
<?php foreach ($cars as $car): ?>
<li style="color:#ccc">
<a href=""><?php echo $car ?>
</a> </li>
<?php endforeach ?>
</ol>
<script>
let cars= ['2020款 35 TFSI 时尚动感型','2021款 55 TFSI quattro 尊享致雅型',
'2018款 典藏版 40 TFSI 进取版','奥迪A7 2021款 40 TFSI 豪华型','奥迪R8 2021款 V10 Coupe performance',
'奥迪RS7 2021款 V10 Coupe performance'];
for(let i = 0; i < cars.length ; i ++){
alert(cars[i]);
}
</script>
<?php
$cars = [‘2020款 35 TFSI 时尚动感型’,’2021款 55 TFSI quattro 尊享致雅型’,
‘2018款 典藏版 40 TFSI 进取版’,’奥迪A7 2021款 40 TFSI 豪华型’,’奥迪R8 2021款 V10 Coupe performance’,
‘奥迪RS7 2021款 V10 Coupe performance’];
?>
##代码全文
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Audi奥迪各系列车型</title>
<style>
/* 去掉链接的下划线 */
ol a{
text-decoration:none;
}
/* 加点鼠标悬停样式 */
ol a:hover{
color:aqua;
}
</style>
</head>
<body>
<h3>一汽-大众 奥迪Audi 部分车型详情</h3>
<ol>
<!-- 用PHP foreach 演绎数组遍历 -->
<!-- 这里用PHP模范语法, : 相当于"{ " , endforeach 相当于 "}" -->
<?php foreach ($cars as $car): ?>
<li style="color:#ccc">
<a href=""><?php echo $car ?>
</a> </li>
<?php endforeach ?>
</ol>
<script>
let cars= ['2020款 35 TFSI 时尚动感型','2021款 55 TFSI quattro 尊享致雅型',
'2018款 典藏版 40 TFSI 进取版','奥迪A7 2021款 40 TFSI 豪华型','奥迪R8 2021款 V10 Coupe performance',
'奥迪RS7 2021款 V10 Coupe performance'];
for(let i = 0; i < cars.length ; i ++){
alert(cars[i]);
}
</script>
</body>
</html>