批改状态:合格
老师批语:
问题1:学习PHP为什么必须要掌握HTML?
首先,html是前段给浏览器执行渲染的,php是后段的程序,能够生成前段代码发送给端,前端的也叫静态代码,后端的叫动态代码,是指一个php文件,可以根据参数的不同,生成不同的前端代码。如果服务器直接放的是html文件,用户请求页面的时候就直接发给浏览器了。
问题2:为什么选择PHP开发动态网站?
开发速度快,代码的可读性高,可以和多种数据库混合使用,可扩展性高,提供面向类和对象的编程,执行速度快,等优点
代码:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<style type="text/css">
table {
border-collapse: collapse;
text-align: center;
width: 800px;
margin: 20px auto;
}
table caption{
font-size: 2rem;
font-weight: bolder;
color: #666;
margin-bottom: 20px;
}
table, th, td{
border: 1px solid #666;
}
table tr:first-child{
background-color: orange;
}
table br:hover{
background-color: #efefef;
color: coral;
}
</style>
</head>
<body>
<ul>
<li>我的订单</li>
<li>我的购物车</li>
<li>custom service</li>
</ul>
<hr>
<br>
<br>
<table>
<caption>商品列表</caption>
<tr>
<th>书名</th>
<th>编号</th>
<th>位置</th>
<th>价格</th>
<th>图样</th>
<th>buy</th>
</tr>
<tr>
<td>梦里花落知多少</td>
<td>1111</td>
<td>1-0-1</td>
<td>
<del style="color: #ccc">100元</del>5元
</td>
<td><img src="http://img3m2.ddimg.cn/81/21/410263902-1_w_1.jpg" width="100" height="100"></td>
<td>
<a href="https://jd.com">buy</a>
</td>
</tr>
<tr>
<td>十万个为什么</td>
<td>1112</td>
<td>1-0-2</td>
<td>
<del style="color: #ccc">200元</del>102元
</td>
<td><img src="http://img3m2.ddimg.cn/81/21/410263902-1_w_1.jpg" width="100" height="100"></td>
<td>
<a href="https://jd.com">buy</a>
</td>
</tr>
<tr>
<td>宇宙的起源</td>
<td>1113</td>
<td>1-0-3</td>
<td>
<del style="color: #ccc">400元</del>200元
</td>
<td><img src="http://img3m2.ddimg.cn/81/21/410263902-1_w_1.jpg" width="100" height="100"></td>
<td>
<a href="https://jd.com">buy</a>
</td>
</tr>
</table>
</body>
</html>点击 "运行实例" 按钮查看在线实例
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号