Blogger Information
Blog 12
fans 0
comment 0
visits 5464
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
HTML学习
。。。
Original
318 people have browsed it

HTML学习

1.表单学习

例子

效果演示1

代码

  1. <form action="get">
  2. <div class="name">
  3. <div>
  4. <label for="username">用户名:</label>
  5. <input type="text" id="username" name="username" autofocus required />
  6. </div>
  7. <div>
  8. <label for="psw">密码:</label>
  9. <input type="password" id="psw" name="password" required />
  10. </div>
  11. <div>
  12. <label for="my-email">邮箱:</label>
  13. <input type="email" id="my-email" name="email" required />
  14. </div>
  15. <div>
  16. <label for="male">性别:</label>
  17. <input type="radio" name="gender" id="male" checked />
  18. <label for="male"></label>
  19. <input type="radio" name="gender" id="female" />
  20. <label for="female"></label>
  21. </div>
  22. <div>
  23. <label for="male">爱好:</label>
  24. <input type="checkbox" name="hobbies[]" id="game" />
  25. <label for="game">游戏</label>
  26. <input type="checkbox" name="hobbies[]" id="programmer" checked />
  27. <label for="programmer">编程</label>
  28. <input type="checkbox" name="hobbies[]" id="shoot" />
  29. <label for="shoot">摄影</label>
  30. <input type="checkbox" name="hobbies[]" id="swim" />
  31. <label for="swim">游泳</label>
  32. </div>
  33. <div>
  34. <label for="vip">会员:</label>
  35. <select name="vip" id="vip">
  36. <option value="1">金牌会员</option>
  37. <option value="2">银牌会员</option>
  38. <option value="3" selected>铜牌会员</option>
  39. <option value="4">普通会员</option>
  40. </select>
  41. </div>
  42. <label for="introduction">个人简介:</label>
  43. <div>
  44. <textarea name="introduction" id="my-introduction" cols="30" rows="10"></textarea>
  45. </div>
  46. <div>
  47. <button>提交</button>
  48. </div>
  49. </form>

2.表单学习

例子

效果演示2

代码

  1. <div class="header">
  2. <h1>管理后台</h1>
  3. <div>
  4. <span>admin</span>
  5. <a href="">退出</a>
  6. </div>
  7. </div>
  8. <!-- 左侧导航 -->
  9. <ul class="nav">
  10. <li><h3><a href="系统管理.html" target="content">系统管理</a></h3></li>
  11. <li><h3><a href="人员管理.html" target="content">人员管理</a></h3></li>
  12. <li><h3><a href="考勤管理.html" target="content">考勤管理</a></h3></li>
  13. <li><h3><a href="内容管理.html" target="content">内容管理</a></h3></li>
  14. <li><h3><a href="网站首页.html" target="content">网站首页</a></h3></li>
  15. <li><h3><a href="修改密码.html" target="content">修改密码</a></h3></li>
  16. </ul>
  17. <!-- 右侧内容区 -->
  18. <iframe src="https://map.baidu.com/@13280886.83,2990092.74,12z" frameborder="2" name="content"></iframe>

3.引入样式和优先级

3.1 行内样式

例子

效果演示3

代码

  1. <h1 style="color:red;font-size: 30px;">h1段落通过行内样式引入CSS样式</h1>

3.2 内部样式

例子

效果演示4

代码

  1. <head>
  2. <meta charset="UTF-8">
  3. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  4. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  5. <title>内部样式表</title>
  6. <!--内部样式表-->
  7. <style type="text/css">
  8. div{
  9. color: green;
  10. }
  11. </style>
  12. </head>
  13. <body>
  14. <div>DIV,通过内部样式表引入样式</div>
  15. </body>

3.3 引入外部样式

例子

效果演示5

代码

  1. <head>
  2. <meta charset="UTF-8">
  3. <title>外部样式表</title>
  4. <!--引入外部样式表-->
  5. <link rel="stylesheet" type="text/css" href="style.css" />
  6. </head>
  7. <body>
  8. <div>DIV,通过外部样式表引入样式</div>
  9. </body>

3.3 行内样式和内部样式表优先级的对比

例子

效果演示6

代码

  1. <head>
  2. <meta charset="UTF-8">
  3. <title>行内样式和内部样式表优先级比较</title>
  4. <!--内部样式表-->
  5. <style type="text/css">
  6. h1{
  7. color: blue;
  8. }
  9. </style>
  10. </head>
  11. <body>
  12. <!--行内样式-->
  13. <h1 style="color:red;">行内样式>内部样式</h1>
  14. </body>

3.3 内部样式和外部样式的比较

例子

效果演示7)

代码

  1. <head>
  2. <meta charset="UTF-8">
  3. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  4. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  5. <title>内部样式表</title>
  6. <!--内部样式表-->
  7. <style type="text/css">
  8. div{
  9. color: green;
  10. }
  11. </style>
  12. </head>
  13. <body>
  14. <div>内部样式表>外部样式表</div>
  15. </body>

3.4 总结

  • 行内样式>内部样式表>外部样式表
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