登陆表单

  1. <!DOCTYPE html>
  2. <html lang="en">
  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>注册界面</title>
  8. <style>
  9. div {
  10. margin: 4px;
  11. }
  12. </style>
  13. </head>
  14. <body>
  15. <form class="reg" action="login.php" method="get">
  16. <h1>用户注册</h1>
  17. <div>
  18. <label for="username">用户名:</label>
  19. <input type="text" id="username" name="username" value="" placeholder="至少8位" autofocus required />
  20. </div>
  21. <div>
  22. <label for="password">密码:</label>
  23. <input type="password" name="password" id="password" placeholder="******" required />
  24. </div>
  25. <div>
  26. <label for="email">邮箱:</label>
  27. <input type="email" name="email" id="email" placeholder="username@email.com" autofocus required />
  28. </div>
  29. <!-- 单选按钮 -->
  30. <div>
  31. <label for="male">性别:</label>
  32. <!-- 所有input.name 必须相同 -->
  33. <input type="radio" name="gender" id="male" checked /><label for="male"></label>
  34. <input type="radio" name="gender" id="female" /><label for="female"></label>
  35. </div>
  36. <!-- 复选框 -->
  37. <div>
  38. <label for="male">爱好:</label>
  39. <!-- 所有input.name 必须是一个数组格式 -->
  40. <input type="checkbox" name="hobbies[]" id="game" checked /><label for="game">游戏</label>
  41. <input type="checkbox" name="hobbies[]" id="programmer" checked /><label for="programmer">编程</label>
  42. <input type="checkbox" name="hobbies[]" id="shoot" /><label for="shoot">摄影</label>
  43. </div>
  44. <!-- 下拉列表 -->
  45. <!-- select.name, option.value , name,value属性不在同一个标签中 -->
  46. <label for="user">地区:</label>
  47. <select name="user" id="user">
  48. <option value="1">江苏</option>
  49. <option value="2">安徽</option>
  50. <option value="3" selected>河南</option>
  51. <option value="4">...</option>
  52. </select>
  53. <div>
  54. <!-- 多行文本框 -->
  55. <p style="margin: 0">备注:</p>
  56. <textarea name="" id="" cols="30" rows="10"></textarea>
  57. </div>
  58. <button>登录</button>
  59. </form>
  60. </body>
  61. </html>

后台架构

  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>简单后台架构</title>
  8. <style>
  9. body {
  10. height: 100vh;
  11. width: 100vw;
  12. display: grid;
  13. grid-template-columns: 10em 1fr;
  14. grid-template-rows: 6em 1fr;
  15. margin: 0;
  16. }
  17. body .header {
  18. grid-column-end: span 2;
  19. border-bottom: 1px solid currentColor;
  20. background-color: #efe;
  21. padding: 2em;
  22. display: flex;
  23. align-items: center;
  24. }
  25. body .header div {
  26. margin-left: auto;
  27. }
  28. body .nav {
  29. background-color: #efc;
  30. margin: 0;
  31. padding-top: 1em;
  32. list-style: none;
  33. }
  34. body iframe {
  35. width: calc(100vw - 10em);
  36. height: calc(100vh - 6em);
  37. border-left: 1px solid currentColor;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <!-- 顶部 -->
  43. <div class="header">
  44. <h1>管理后台</h1>
  45. <div>
  46. <span>admin</span>
  47. <a href="#">退出</a>
  48. </div>
  49. </div>
  50. <!-- 左侧导航 -->
  51. <ul class="nav">
  52. <li><a href="登录界面.html" target="content">菜单项1</a></li>
  53. <li><a href="demo2.html" target="content">菜单项2</a></li>
  54. <li><a href="demo1.html" target="content">菜单项3</a></li>
  55. </ul>
  56. <!-- 右侧内容区 -->
  57. <iframe src="" frameborder="2" name="content"></iframe>
  58. </body>
  59. </html>

样式来源与优先级

样式来源

  • 浏览器默认的样式,继承自html
  • 自定义样式
    1. 行内样式 style属性
    2. 文档样式 style标签
    3. 外部样式 css文档,使用link标签引入


样式优先级

行内样式 > 文档样式style标签 > 外部样式css文件 > 默认样式

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=\, initial-scale=1.0" />
  7. <title>Document</title>
  8. <link rel="stylesheet" href="./css/main.css" />
  9. <!-- 外部样式是h1 {color: green;} -->
  10. <style>
  11. h1 {
  12. color: blue;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <h1 style="color: red">晚上好</h1>
  18. <h1>吃了吗?</h1>
  19. <h1>xxx</h1>
  20. </body>
  21. </html>

更多相关文章

  1. 表单,后台,元素样式的实例演示
  2. 登录表单+iframe后台架构+css优先级
  3. 1. 写一个登录表单,要求有邮箱,密码,登录按钮 2. 写一个简单后台
  4. 一个简单的登陆表单、后台框架及实例演示元素样式来源和优先级
  5. form表单提交、使用iframe编写后台简单布局、css样式分类与优先
  6. 实例演示元素来源与优先级
  7. 表单、内联框架以及CSS基础学习小结
  8. android 线程优先级设置
  9. Android的TextView/EditText使用CharacterStyle&SpannableString

随机推荐

  1. 这些有趣的 API 着实有点炫
  2. 关于 刚刚放假在家准备认真学习的自我保
  3. 学习C第二天-转义字符
  4. 自己能挖到比特币吗?比特币到底有多香?
  5. flask示例
  6. C#基础入门第十二天(面向对象多态,File操作
  7. JavaWeb-LayUI框架的介绍与使用方式(前端
  8. 服务器Tomcat,你会安装了吗?
  9. 聊一聊我们应该如何有效学习
  10. 熔断器 Hystrix 源码解析 —— 命令执行(