Blogger Information
Blog 16
fans 0
comment 1
visits 5808
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
html常用标签
P粉890456325
Original
316 people have browsed it

0113作业

1. 写出html文档结构,并解释每个成员的功能与作用

  1. <!-- 1. 文档类型元素 -->
  2. <!DOCTYPE html>
  3. <!-- 2. 根元素: 浏览器渲染html的起点,入口 -->
  4. <!-- lang="zh-CN": 属性,标签的特征,用"键(lang),值(zh-CN)对"的方式来表示 -->
  5. <html lang="zh-CN">
  6. <!-- 根元素只有二个子元素 <head><body> -->
  7. <!-- 2.1 头元素: 浏览器, 搜索引擎SEO-->
  8. <head>
  9. <!-- 2.1.1 元标签,中介,媒婆 -->
  10. <!-- 页面编码 -->
  11. <meta charset="utf-8" />
  12. <!-- 兼容模式: 多余的 -->
  13. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  14. <!-- 视口设置: 视口(可视窗口), 375px 375px -->
  15. <meta name="viewport" content="width=device-width,initial-scale=1.0" />
  16. <!-- 页面标题 -->
  17. <title>html结构</title>
  18. <!-- 页面主体 -->
  19. <body>
  20. <!-- <girl-friend height="170" weight="110" bwh="88,86,84">小刘亦菲</girl-friend> -->
  21. <!--
  22. 1. 元素: 女朋友
  23. 2. 标签: <girl-friend>
  24. 3. 属性: height,weight,bwh(bust,waist,hips)
  25. 通用属性, 姓名,性别,年龄,学历
  26. -->
  27. <h1 id="header" class="title" style="color: red">Hello, binbin</h1>
  28. <!--
  29. 1. 元素: 大标题
  30. 2. 标签: <h1>
  31. 3. 属性: id,class,style (通用属性/预定义)
  32. 预置标签: w3c制定,各家浏览器实现
  33. -->
  34. <!-- 双标签: 起始标签和结束标签,内容写到他们之间,属性写到起始标签中 -->
  35. <!-- 单标签: 空标签,它的内容由某个属性来设置,本质上"资源占位符" -->
  36. <!-- <input type="text" value="admin" />
  37. <img src="url" alt="" />
  38. <link rel="stylesheet" href="style.css" /> -->
  39. <!--
  40. 1. 双标签: 自身内容,由开发人员自己写
  41. 2. 单标签: 外部资源的占位符,空标签
  42. 3. 预定义标签: <h1>,<input>,<div>,<ul>...
  43. 4. 预定义属性: id,class,style, src,type,value,name...
  44. 5. 自定义标签: <girl-friend>
  45. 6. 自定义属性: height,weight,bwh(bust,waist,hips)
  46. 7. 标准化的自定义属性: "data-"自定义属性固定前缀
  47. -->
  48. </body>
  49. </head>
  50. </html>

‘’’

2. 演示布局元素,重点是 tag+class

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. <!-- <div id="header">页眉</div>
  11. <div id="mains">主体</div>
  12. <div id="footer">页脚</div>
  13. <hr />
  14. <div class="header">页眉</div>
  15. <div class="mains">主体</div>
  16. <div class="footer">页脚</div>
  17. </body>
  18. </html>

3. 演示图文的语义化解决方案

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. <header>页眉</header>
  11. <main>主体</main>
  12. <footer>页脚</footer>
  13. <hr />
  14. -->
  15. <style>
  16. .article.header{
  17. color: red;
  18. }.article.main{
  19. color: rgb(4, 255, 0);
  20. }.article.footer{
  21. color: rgb(47, 0, 255);
  22. }
  23. </style>
  24. <!-- <article>
  25. <header class="article header">文章头部</header>
  26. <main class="article main">文章主体</main>
  27. <footer class="article footer">文章底部</footer>
  28. </article> -->
  29. <div class="article header">页眉</div>
  30. <div class="article main">主体</div>
  31. <div class="article footer">页脚</div>
  32. </body>
  33. </html>

4. 演示图像,链接与列表元素

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. <div></div>
  11. <div class="box">
  12. <img src="https://img.php.cn/upload/aroundimg/000/000/001/63b69d4c2de93667.png" alt="">
  13. <p class="title">二十二期</p>
  14. </div>
  15. <hr />
  16. <figure>
  17. <img src="https://img.php.cn/upload/aroundimg/000/000/001/63b69d4c2de93667.png" alt="php" width="200">
  18. <figcaption>二十二期</figcaption>
  19. </figure>
  20. <a href="https://php.cn" target="_self">php.cn</a>
  21. <a href="https://php.cn">
  22. <img src="https://img.php.cn/upload/aroundimg/000/000/001/63b69d4c2de93667.png" alt="php" width="200"></a>
  23. <a href="https://php.cn" target="_blank"><button>abcd</button></a>
  24. <!-- 无序列表 -->
  25. <ul>
  26. <li>itme1</li>
  27. <li>itme2</li>
  28. <li>itme3</li>
  29. </ul>
  30. <!-- 有序列表 -->
  31. <ol>
  32. <li>itme1</li>
  33. <li>itme2</li>
  34. <li>itme3</li>
  35. </ol>
  36. <!-- 自定义列表 -->
  37. <dl>
  38. <dt>itme1</dt>
  39. <dd>itme1</dd>
  40. <dd>itme2</dd>
  41. <dd>itme3</dd>
  42. <dt>itme2</dt>
  43. <dd>itme1</dd>
  44. <dd>itme2</dd>
  45. <dd>itme3</dd>
  46. <dt>itme3</dt>
  47. <dd>itme1</dd>
  48. <dd>itme2</dd>
  49. <dd>itme3</dd>
  50. </dl>
  51. </body>
  52. </html>
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post