批改状态:合格
老师批语:
首先配置一个自建表格界面,并引用外链图片,先做一个单页的静态页面,取名
NationalFootballTeam.html
<!DOCTYPE html><html lang="zh-CN"><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>国足12强赛赛程时间表</title><style>/* 给表格添加一个边框,并将表格内所有文字进行居中 */table,tr,th,td {border: 1px solid hotpink;text-align: center;}/* 给标题做一个字体加粗 */caption {font-weight: bolder;}/* 配置回到顶部漂浮窗的字体横向居中,宽高,背景色,固定定位布局,具体定位位置,圆角 */.top {text-align: center;height: 36px;width: 116px;background-color: hotpink;position: fixed;left: 768px;top: 324px;border-radius: 6px;}/* 配置回到顶部漂浮窗的字体垂直居中,字体颜色改为白色,改为定位元素,去掉下划线 */.top > p {bottom: 10px;color: white;position: relative;text-decoration: none;}</style></head><body><!-- 设置表格 --><div class="table"><!-- 用cellspacing优化表格的边框 --><table cellspacing="0;"><!-- 配置标题 --><caption>国足12强赛赛程时间表</caption><!-- 设置表头 --><thead><tr><!-- thead里面的单元格使用th表示,可以自动居中加粗 --><th>时间</th><!-- 使用colspan进行列合并,但是需要注意,需合并的列,要与下方的列的个数对应 --><th colspan="4">主客场情况</th></tr></thead><!-- 填充表体内容 --><tbody><tr><td>2021年9月2日</td><td>澳大利亚</td><td>vs</td><td>中国</td><td>客场</td></tr><tr><td>2021年9月7日</td><td>中国</td><td>vs</td><td>日本</td><!-- 使用rowspan进行行合并,但是需要注意,需合并的行,要与下方的行的个数对应 --><td rowspan="2">主场</td></tr><tr><td>2021年10月7日</td><td>中国</td><td>vs</td><td>越南</td></tr><tr><td>2021年10月12日</td><td>沙特阿拉伯</td><td>vs</td><td>中国</td><td>客场</td></tr><tr><td>2021年11月11日</td><td>中国</td><td>vs</td><td>阿曼</td><td rowspan="2">主场</td></tr><tr><td>2021年11月16日</td><td>中国</td><td>vs</td><td>澳大利亚</td></tr><tr><td>2022年1月27日</td><td>日本</td><td>vs</td><td>中国</td><td rowspan="2">客场</td></tr><tr><td>2022年2月1日</td><td>越南</td><td>vs</td><td>中国</td></tr><tr><td>2022年3月24日</td><td>中国</td><td>vs</td><td>沙特阿拉伯</td><td>主场</td></tr><tr><td>2022年3月29日</td><td>阿曼</td><td>vs</td><td>中国</td><td>客场</td></tr></tbody><tfoot><tr><td>统计</td><td colspan="4">主场:5,客场:5</td></tr></tfoot></table></div><!-- 用#加id的值,作为a标签的href属性的值,做两个锚点链接,使得能跳转到下面下方查看相关内容 --><div class="search"><a href="#details">查看详细情况</a></div><div class="search"><a href="#grouping">查看分组情况</a></div><!-- 锚点一 --><div id="details"><img src="https://i0.hdslb.com/bfs/article/7dc92730ed4b6d5ee041cc1c3083ec2a42a786c6.jpg" alt="详细情况" /></div><!-- 锚点二 --><div id="grouping"><img src="https://i0.hdslb.com/bfs/article/47ce041e996b9091f6ceed1ba3b1e9bce139c2a4.jpg" alt="分组情况" /></div><!-- 设置一个悬浮窗,使得可以随时点击回到顶部,a标签的href属性的值设置为#,可以直接跳转回顶部 --><a href="#"><div class="top"><p>回到顶部</p></div></a></body></html>
建立网站主页面,此处调用了淘宝、hao123、网易、腾讯外链及自建的内链,并将 php 中文网的图片及链接加在下导航作为底部
<!-- 文档类型 --><!DOCTYPE html><!-- 根元素,通常也叫root,这里的lang表明了语言使用的是中文 --><html lang="zh-CN"><head><!-- 设置字体编码格式,一般常用UTF-8 --><meta charset="UTF-8" /><!-- 兼容老版本,基本弃用 --><meta http-equiv="X-UA-Compatible" content="IE=edge" /><!-- 设置视口:可视窗口 content设置宽度为设备宽度 initial-scale设置代码比例为代码一比一比例 --><meta name="viewport" content="width=device-width, initial-scale=1.0" /><style>/* 初始化配置*/:root {margin: 0;padding: 0;box-sizing: border-box;font-size: 10px;}/* 设置背景色,将字体大小恢复至16px */body {background: cornflowerblue;font-size: 1.6rem;}/* 上导航按钮栏使用flex横向布局,去掉ul的小点 */.menu {display: flex;place-content: space-around;list-style-type: none;}/* 设置字体居中及每个区块的宽高,将该元素设置为定位元素 */li {text-align: center;height: 5rem;width: 20rem;position: relative;}/* 给menu下的a标签设置白色字体、去掉下划线、定位元素、垂直居中 */.menu > li > a {color: white;text-decoration: none;position: relative;top: 1.45rem;}/* 设置鼠标经过menu下的a标签的时候,字体变为蓝色 */.menu > li > a:hover {color: blue;}/* 给内容区设置宽度100%,高度80%的可视窗口,背景改回白色 */.main-main iframe {width: 100%;height: 760px;background: white;}</style><title>网站后台</title></head><body><!-- 首先搭建网站的基本主架构,用三个div块元素将页面分为上中下三块 --><!-- 上导航 --><div class="main-header"><!-- 使用无序列表配置上导航菜单栏 --><ul class="menu"><!-- 每个无序列表中放一个a标签,将目标链接放进href属性中,并将target的值设置为内容区iframe的name值,使得点击该元素时,会在内容区的iframe中展示相关内容 --><li><a href="https://www.qq.com/" target="main">腾讯网首页</a></li><li><a href="https://www.taobao.com/" target="main">淘宝网</a></li><li><a href="https://www.hao123.com/" target="main">hao123</a></li><li><a href="NationalFootballTeam.html" target="main">国足12强赛赛程时间表</a></li><li><a href="https://www.163.com/" target="main">网易</a></li></ul></div><!-- 内容区 --><div class="main-main"><!-- 将内容区iframe默认的src改为srcdoc,并在后面输入需要展示的文本内容,并将默认的边框设置为0,设置好name属性,让上面的a标签组成的按钮可以正常使用 --><iframe srcdoc="请点击上方链接打开相关内容" frameborder="0" name="main"></iframe></div><!-- 下导航 --><div class="main-footer"><div class="address"><!-- 加一个友情链接的文本 --><span>友情链接:</span><!-- 在a标签中加入php中文网的图片,点击跳转php中文网 --><a href="https://www.php.cn/"><img src="https://www.php.cn/static/images/logo.png" alt="php中文网" /></a></div></div></body></html>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号