web应用开发课程设计报告(《Web应用开发》(头歌))
导读:实验一 HTML基础 HTML——表单类的标签...
实验一 HTML基础
HTML——表单类的标签
第1关 表单元素——文本框
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <!-- ********* Begin ********* --> 昵称:<input type="text" name="nickName"/> <!-- ********* End ********* --> </body> </html>第2关 表单元素——密码框
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <!-- ********* Begin ********* --> 密码:<input type="password" name="check" value="123"/> <!-- ********* End ********* --> </body> </html>第3关 表单元素——单选框
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> 1. HTML是什么语言?(单选题)<br> <!-- ********* Begin ********* --> <p><input type="radio" name="question"/>A:高级文本语言<p> <input type="radio" name="question"/>B:超文本标记语言<p> <input type="radio" name="question"/>C:扩展标记语言<p> <input type="radio" name="question"/>D:图形化标记语言 <!-- ********* End ********* --> </body> </html>第4关 表单元素——多选框
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> 休闲方式:<br> <!-- ********* Begin ********* --> <p><input type="checkbox" name="relax"/>逛街<p> <input type="checkbox" name="relax"/>看电影<p> <input type="checkbox" name="relax"/>宅 <!-- ********* End ********* --> </body> </html>第5关 表单元素——checked属性
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> 婚姻状况:<br> <!-- ********* Begin ********* --> <p><input type="radio" name="marry" checked="checked"/>未婚 <p><input type="radio" name="marry"/>已婚 <!-- ********* End ********* --> </body> </html>第6关 表单元素——disabled 属性
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> 难度系数:<br> <!-- ********* Begin ********* --> <p><input type="radio" name="degree"/>简单 <p><input type="radio" name="degree"/>中等 <p><input type="radio" name="degree" disabled="disabled"/>困难 <!-- ********* End ********* --> </body> </html>第7关 表单元素——label 标签
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <!-- ********* Begin ********* --> <label for="user">用户:</label><input type="text" id="user" name="user"/><br> <label for="pwd">密码:</label><input type="password" id="pwd" name="password"/><br> <!-- ********* End ********* --> </body> </html>第8关 表单元素——下拉列表
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> 选择版块: <!-- ********* Begin ********* --> <select> <option>问答</option> <option>分享</option> <option>招聘</option> <option selected="selected">客户端测试</option> <!-- ********* End ********* --> </body> </html>第9关 表单元素——文本域
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <!-- ********* Begin ********* --> <style> textarea { width:200px; height:120px; } </style> </head> <body> 用一句话描述自己的特点:<textarea maxlength="15"></textarea> <!-- ********* End ********* --> </body> </html>第10关 表单元素——提交按钮
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <label for="user">用户:</label><input type="text" id="user" name="user"/><br> <label for="pwd">密码:</label><input type="password" id="pwd" name="password" style="margin-bottom: 10px;"/><br> <!-- ********* Begin ********* --> <input type="submit" value="submit"/> <!-- ********* End ********* --> </body> </html>第11关 表单元素的综合案例
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style> .container{ width: 40%; margin: 20px auto; } .common{ width:230px; height: 30px; } span{ display:inline-block; width: 150px; text-align: right; } div{ margin-bottom: 10px; } </style> </head> <body> <form class="container"> <!-- ********* Begin ********* --> <div> <span>用户名:</span> <input type="text" class="common"/> </div> <div> <span>昵称:</span> <input type="text" class="common"/> </div> <div> <span>性别:</span> <label for="male"> <input type="radio" id="male" name="sex"/>男 </label> <label for="female"> <input type="radio" id="female"name="sex"/>女 </label> <label for="other"> <input type="radio" id="other" name="sex" disabled="disabled"/>保密 </lable> </div> <div> <span>教育程度:</span> <select class="common"> <option>高中</option> <option>中专</option> <option>大专</option> <option selected="selected">本科</option> <option>硕士</option> <option>博士</option> <option>其他</option> </select> </div> <div> <span>婚姻状况:</span> <label for="single" name="state"> <input type="radio" checked="checked" id="single"/>未婚 </label> <label for="married" name="state"> <input type="radio" id="married"/>已婚 </label> <label for="secret" name="state"> <input type="radio" id="secret"/>保密 </label> </div> <div> <span>兴趣爱好:</span> <label for="football" name="hobby"> <input type="checkbox" id="football"/>踢足球 </label> <label for="basketball" name="hobby"> <input type="checkbox" id="basketball"/>打篮球 </label> <label for="film"> <input type="checkbox" id="film" checked="checked" name="hobby"/>看电影 </label> </div> <div> <span>描述自己的特点:</span> <textarea maxlength="20" class="common"></textarea> </div> <div > <span></span> <input type="submit" value="提交" class="common"/> </div> <!-- ********* End ********* --> </form> </body> </html>HTML入门——基础
第1关 初识HTML:简单的Hello World网页制作
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Hello world</title> </head> <!--------- Begin--------> <body bgcolor="F6F3D6"> <!--用HTML语言向世界打声招呼吧!--> <h1 align="center">Hello World</h1> <p align ="center">动手改变世界</p> </body> <!--------- End--------> </html>第2关 HTML结构:自我简介网页
<!DOCTYPE html> <html> <!--------- Begin--------> <head> <meta charset="utf-8"> <title>自我简介</title> <meta name="description" content="XXX的自我简介网站"> <meta name="keywords" content="自我简介,关键词一,关键词二,关键词三"> </head> <body> <h1 align="center">自我简介</h1> <h2>简介</h2> <p>在这里简单的描述一下你自己吧 。</p> <h2>三个与你最有关的词</h2> <p>这三个词可以是一种形容 ,也可以是一种运动或者是一种独特的爱好 ,等等 。</p> <ul> <li>坚强</li> <p>在心理和身体极度糟糕的情况下坚持了下来</p> <li>乐观</li> <p>以前比较乐观 ,不管发生了什么 ,都能够快速找回状态</p> <li>阳光</li> <p>我希望我自己能快乐并且别人带来快乐</p> </ul> </body> <!--------- End--------> </html>HTML入门——文本
第1关 HTML链接:带超链接的网页
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML链接</title> <meta name="description" content="HTML链接知识讲解"> <meta name="keywords" content="HTML, Link"> </head> <!--------- Begin--------> <body> <h1>HTML 入门</h1> <h2>本页目录</h2> <ul> <li><a href="#toc1">简介</a></li> <li><a href="#toc2">第1关</a></li> <li><a href="#toc3">第2关</a></li> </ul> <h2 id="toc1">简介</h2> <p> <a href="https://en.wikipedia.org/wiki/HTML" target="_blank">HTML</a>(Hypertext Markup Language ,超文本标记语言)是一种用于创建Web页面和Web应用的标准化标记语言。在 <a href="https://en.wikipedia.org/wiki/CSS" target="_blank">CSS</a>(Cascading Style Sheets ,级联样式表单)和 <a href="https://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a>的帮助下 ,HTML已经成功构建了一整套面向Web的开发与应用平台 。</p> <p>自1995年HTML2.0面世 ,HTML陆续推出了得到广泛应用的HTML3.2和HTML4.0标准 ,2014年HTML5标准的面世使其在多媒体和移动性方面得到了全面提升,使HTML迎来了新的爆发式发展 。</p> <h2 id="toc2">第1关</h2> <p>初识HTML:简单的Hello World网页</p> <h2 id="toc3">第2关</h2> <p>HTML链接:带超链接的网页</p> <hr> <p>若需帮助 ,请发送问题到<a href="mailto:someone@email.com">E-Mail</a> 。</p> <p><a href="#">回到顶部</a></p> </body> <!--------- End--------> </html>第2关 HTML标题与段落:网络文章网页
<!DOCTYPE html> <head> <meta charset="UTF-8" /> <title>HTML – 维基百科</title> </head> <!--------- Begin--------> <body> <h1>HTML</h1> <p>超文本标记语言(HTML)是一种标准化的用来创建Web页面和Web应用的标准化的 <a href="https://en.wikipedia.org/wiki/Markup_language" title="Markup language" target="_blank">标记语言</a> 。 在级联样式表单(CSS)和JavaScript的帮助下 ,HTML已经成功构建了一整套面向Web的开发与应用平台<sup><a href="#ref1">[1]</a></sup> 。 </p> <h2>历史</h2> <h3>开发过程</h3> <p>1980年,物理学家<a href="https://en.wikipedia.org/wiki/Tim_Berners-Lee" title="Tim Berners-Lee" target="_blank">Tim Berners-Lee</a> , <a href="https://en.wikipedia.org/wiki/CERN" title="CERN" target="_blank">CERN</a>的一位项目负责人 ,提出并实现了<a href="https://en.wikipedia.org/wiki/ENQUIRE" title="ENQUIRE" target="_blank">ENQUIRE</a>系统 。该系统的目的是为CERN研究人员提供一种使用和分享文档 。1989年, Berners-Lee写了一个备忘录 ,提出了基于Internet-based <strong>超文本系统</strong><sup><a href="#ref2">[2]</a></sup> 。 </p> <h3>HTML里程碑</h3> <dl> <dt>1995年11月24日</dt> <dd>HTML2.0发布 ,对应的IETF文档为<a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc1866" target="_blank">RFC 1866</a> 。</dd> <dt>1997年1月14日</dt> <dd>HTML 3.2以 <a href="https://en.wikipedia.org/wiki/W3C_Recommendation" class="mw-redirect" title="W3C Recommendation" target="_blank"> <abbr title="World Wide Web Consortium">W3C</abbr>推荐标准</a>的形式发布。 随后的HTML标准都由W3C组织发布 。</dd> <dt>1997年12月18日</dt> <dd>HTML 4.0发布<sup><a href="#ref3">[3]</a></sup> 。</dd> <dt>2014年10月28日</dt> <dd>HTML5 发布。</dd> <dt>2016年11月1日</dt> <dd>HTML 5.1发布 。</dd> </dl> <h2>参考文献</h2> <ol> <small> <li id=ref1>Flanagan, David. <i>JavaScript - The definitive guide</i> (6 ed.). p. 1. "JavaScript is part of the triad of technologies that all Web developers must learn: HTML to specify the content of web pages, CSS to specify the presentation of web pages, and JavaScript to specify the behaviour of web pages."</li> <li id="ref2">Tim Berners-Lee, "Information Management: A Proposal." CERN (March 1989, May 1990). </li> <li id="ref3">"HTML 4.0 Specification — W3C Recommendation — Conformance: requirements and recommendations". World Wide Web Consortium. December 18, 1997. Retrieved July 6, 2015.</li> </small> </ol> </body> <!--------- End--------> </html>第3关 HTML表格:日常消费账单表格展示网页
<!DOCTYPE html> <html> <!--------- Begin--------> <head> <meta charset="utf-8"> <title>HTML表格</title> <meta name="description" content="HTML表格知识讲解"> <meta name="keywords" content="HTML,表格, Table"> <style type="text/css"> table { border-collapse: collapse; } caption { font-weight: bold; margin-bottom: .5em; } th, td { padding: .5em .75em; border: 1px solid #000; } tfoot { font-weight: bold; } </style> </head> <body> <table border="1" style="margin:auto" width="400"> <caption>日常消费账单</caption> <thead> <!-- 表格头部 --> <tr> <th align="left" scope="col">消费项目</th> <th align="right" scope="col">一月</th> <th align="right" scope="col">二月</th> </tr> </thead> <tbody> <!-- 表格主体 --> <tr> <th align="left" scope="row">食品烟酒</th> <td align="right">¥1241.00</td> <td align="right">¥1250.00</td> </tr> <tr> <th align="left" scope="row">衣物</th> <td align="right">¥330.00</td> <td align="right">¥594.00</td> </tr> <tr> <th align="left" scope="row">居住</th> <td align="right">¥2100</td> <td align="right">¥2100</td> </tr> <tr> <th align="left" scope="row">生活用品及服务</th> <td align="right">¥700.00</td> <td align="right">¥650.00</td> </tr> <tr> <th align="left" scope="row">医疗保健</th> <td align="right">¥150.00</td> <td align="right">¥50.00</td> </tr> <tr> <th align="left" scope="row">教育 、文化和娱乐</th> <td align="right">¥1030.00</td> <td align="right">¥1250.00</td> </tr> <tr> <th align="left" scope="row">交通和通信</th> <td align="right">¥230.00</td> <td align="right">¥650.00</td> </tr> <tr> <th align="left" scope="row">其他用品和服务</th> <td align="right">¥130.40</td> <td align="right">¥150.00</td> </tr> </tbody> <tfoot> <!-- 表格尾部 --> <tr> <th align="left" scope="row">总计</th> <th align="right">¥5911</th> <th align="right">¥6694</th> </tr> </tfoot> </table> </body> <!--------- End--------> </html>HTML——基本标签
第1关 创建第一个 HTML 标签
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <h1>Hello</h1> <!-- ********* Begin ********* --> <h1>welcome to Educoder</h1> <!-- ********* End ********* --> </body> </html>第2关 创建 h2-h6 标签
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <h1>创建不同字体大小的标题</h1> <!-- ********* Begin ********* --> <h1>创建不同字体大小的标题</h1> <h2>创建不同字体大小的标题</h2> <h3>创建不同字体大小的标题</h3> <h4>创建不同字体大小的标题</h4> <h5>创建不同字体大小的标题</h5> <h6>创建不同字体大小的标题</h6> <!-- ********* End ********* --> </body> </html>第3关 创建 p 标签
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <!-- ********* Begin ********* --> <p>我是一个段落</p> <!-- ********* End ********* --> </body> </html>第4关 创建 a 标签
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <!-- ********* Begin ********* --> <a href="https://www.educoder.net">Educoder平台</a> <!-- ********* End ********* --> </body> </html>第5关 创建 img 标签
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <!-- ********* Begin ********* --> <img src="https://www.educoder.net/attachments/download/207801" alt="小狗走路"/> <!-- ********* End ********* --> </body> </html>第6关 创建 div 标签
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <h2>我是h2标签</h2> <p>我是p标签</p> <!-- ********* Begin ********* --> <div>我是div标签</div> <!-- ********* End ********* --> </body> </html>实验二 css入门
使用 HTML/CSS 实现 Educoder 顶部导航栏
第1关 使用flex布局实现Educoder顶部导航栏容器布局
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Educoder</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script> <script src="step1/verify.js"></script> </head> <style type="text/css"> body { padding: 0; margin: 0; } .color-white { color: white; } /*********** Begin ************/ .container{ display:flex; justify-content: space-between; height:60px; } /*********** End ************/ </style> <body> <div class="container"> <header style="background-color:#24292D;min-width:1200px;"> <div class="left-wrap color-white">左边容器</div> <div class="right-wrap color-white">右边容器</div> </header> </div> </body> </html>第2关 使用flex布局实现Educoder顶部导航栏容器布局
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Educoder</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script> <script src="step2/verify.js"></script> </head> <style type="text/css"> body { padding: 0; margin: 0; } .container { min-width: 1200px; } .flex { display: flex; } header { background: #24292D; height: 60px; justify-content: space-between; padding: 0 25px; } header > div { height: 100%; display: flex; align-items: center; } /*********** Begin ************/ .logo-block{ display: flex; align-items: center; justify-content: center; } .logo { width: 40px; height: 38px; margin-right: 30px; } .menu-item { color: #ffffff; font-size: 16px; width: 64px; height: 100%; display: flex; align-items: center; margin-right: 30px; position: relative; } .hot{ position: absolute; top: 10px; right: -22px; } /*********** End ************/ </style> <body> <div class="container"> <header class="flex"> <div class="left-wrap"> <!--********** Begin **********--> <div class="logo-block"> <img src="https://data.educoder.net/images/educoder/headNavLogo.png?1526520218" class="logo"> </div> <div class="menu-block full-height flex"> <div class="menu-item"><span>实践课程</span></div> <div class="menu-item"><span>翻转课堂</span></div> <div class="menu-item"><span>实训项目</span></div> <div class="menu-item"><span>在线竞赛<img class="hot" src="https://www.yuucn.com/wp-content/uploads/2023/04/1682315694-990685f216439cd.png"></span></div> <div class="menu-item"><span>教学案例</span></div> <div class="menu-item"><span>交流问答</span></div> </div> <!--********** End **********--> </div> <div class="right-wrap"> </div> </header> </div> </body> </html>第3关 实现右侧功能图标排序
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Educoder</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script> <script src="step3/verify.js"></script> </head> <style type="text/css"> body { padding: 0; margin: 0; } .container { min-width: 1200px; } .flex { display: flex; } .full-height{ height: 100%; } header { background: #24292D; height: 60px; justify-content: space-between; padding: 0 25px; } header > div { height: 100%; display: flex; align-items: center; } .logo-block{ display: flex; align-items: center; justify-content: center; } .logo { width: 40px; height: 38px; margin-right: 30px; } .menu-item { color: #ffffff; font-size: 16px; width: 64px; height: 100%; display: flex; align-items: center; margin-right: 30px; position: relative; } .hot{ position: absolute; top: 10px; right: -22px; } /*********** Begin ************/ .icon-item{ height: 100%; width: 48px; display: flex; align-items: center; justify-content: center; } .user{ width: 34px; height: 34px; margin-left: 15px; } /*********** End ************/ </style> <body> <div class="container"> <header class="flex"> <div class="left-wrap"> <div class="logo-block"> <img src="https://www.yuucn.com/wp-content/uploads/2023/04/1682315702-990685f216439cd.png?1526520218" class="logo"> </div> <div class="menu-block full-height flex"> <div class="menu-item"><span>实践课程</span></div> <div class="menu-item"><span>翻转课堂</span></div> <div class="menu-item"><span>实训项目</span></div> <div class="menu-item"><span>在线竞赛<img class="hot" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAYAAAAFzx/vAAACl0lEQVRIS62UP0gbURzHP09DUrHW1EqHuLhYBC0t1NOCg4M432IXhxZKDwShxUA7iuLmoLUEXHSRghk1OLgaaCrnn6FD6aFUEDoIYq5NxBBNXnkvl3hWi4N5y927e+/3+f2+vz9CQhCYAl4C96nSkoC4sJUGFoEPQsJH4F2VODeZmVVARQ/fdPI2/1W0XsSuAqr30qqrg85O2N0F1726V2ciEejqQp6fI1IppOsivG9+p5TRguOQcxxOgbzaK5kvAQ0DbBtME5lIgGEg/PupKUQ0CtksBIOQz8PQEDIQQKysXBFhf3yc3YmJSkQ1/wNK0wQfUO8PDhBbW8j5eRgehnAYsb6ObGzkuLWVQ+DUMHhm22ybJr/VfUBDfE8dYUVTLyK5tASOAy0tCMtCAUVzMywsIPv6EMmklic3Okr99DRf2trI7e1x1zDosW2+mSaZf4AVeNGfwzJQ5TCTgVAI0dGhJda5m5uD3l5yqRQ/gcDICI9iMba7u8ltblJvGDy1bb77gApUbg8d7XVADfAkVTnVEabTkEySjUZxZmY4AdqXl2nq72enoUHn6Y5h8MS2+WGa/Ekk/H2o5VVgBdRtob3wikYDfEDlwFkiQX51lbqBAdIbG9SGQoR7ejgYG+NwclIbVMDHto3jAf1VpFJQA2lRgFngrfZAyWZZEI+XchiJULAsTuJxfjkOLtA0OEhDezuyWCSzs8PJ2lqlCgORCA8ti6N4XLdDuTaKXh9K+KSKJlgsjbZXAsIXTQk54Ag4Bs6AWq/alHPlc0oZ9a6MquUzrr97/9wCLD6A975xV7og4Svw3Lu/BrwQkL3NpPHfvQ64D7QCn4HXohRc1dZ1QDWJYnqy+1umSshLQAn3gDcCpqtk/4qZv02gFT1dbcRiAAAAAElFTkSuQmCC"></span></div> <div class="menu-item"><span>教学案例</span></div> <div class="menu-item"><span>交流问答</span></div> </div> </div> <div class="right-wrap"> <!--********** Begin **********--> <div class="icon-list full-height flex"> <div class="icon-item"><img src="https://data.educoder.net/api/attachments/411643" alt=""></div> <div class="icon-item"><img src="https://data.educoder.net/api/attachments/411644" alt=""></div> <div class="icon-item"><img src="https://data.educoder.net/api/attachments/411645" alt=""></div> </div> <img class="user" src="https://data.educoder.net/images/avatars/User/b?t=1569204859650" alt=""> <!--********** End **********--> </div> </header> </div> </body> </html>第4关 实现左侧鼠标悬停效果与选中状态
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Educoder</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script> <script src="step4/verify.js"></script> </head> <style type="text/css"> body { padding: 0; margin: 0; } .container { min-width: 1200px; } .flex { display: flex; } .full-height { height: 100%; } header { background: #24292D; height: 60px; justify-content: space-between; padding: 0 25px; } header > div { height: 100%; display: flex; align-items: center; } .logo-block { display: flex; align-items: center; justify-content: center; } .logo { width: 40px; height: 38px; margin-right: 30px; } .menu-item { color: #ffffff; font-size: 16px; width: 64px; height: 100%; display: flex; align-items: center; margin-right: 30px; position<%创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!