当前位置:   article > 正文

web的学习和开发

web的学习和开发

这个使同步和异步的区别

今天主要就是学了一些前端,搞了一些前端的页面,之后准备学一下后端。

我写的这个项目使百度贴吧,还没有写er图。

  先看一下主界面是什么样子的。

这个是主界面,将来后面的主要功能点基本上全部是放在这个上面,如热推信息,还一些很火的贴吧信息全部写在这个上面。

上面这个注册是一个超链接,当我点击这个超链接的时候就会转跳到注册界面。

超链接在html中的标签是

 <a href="注册.html" target="_blank">注册</a>

先解释一下这个_blank就是重新创建一个页面然后转跳到这个页面。然后这个"注册.html"就是新创建的注册的界面

跳转到注册界面是这样的

这个注册还没有搞正则表达式,也没有搞前后端交互。感觉前后端交互现在还不是很清楚,希望之后可以早点吧这个前后端的交互搞明白。

这个搞了我比较久就是这个“用科技让复杂的世界变简单”,刚开始我以为这两端文字两个div和在一起的,后面当时在原来的界面使用这个画面放缩的时候发现这两行是一个div。一致想不明白怎么实现让一大一小的文字一起进行放缩,后面才知道那个大一点其实就是h3一个标题的标签,那个较小的文字是p换行的文字,然后对这两段文字进行css修饰(将这两端文字染色呈白色,然后将这个文字,将这两段文字的间距进行加宽)。

代码如下

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>注册界面</title>
  7. <style>
  8. body {
  9. margin: 0;
  10. display: flex;
  11. height: 100vh;
  12. background-image: url('./reg_bg_min.jpg');
  13. background-size: cover;
  14. background-position: center;
  15. background-repeat: no-repeat;
  16. background-attachment: fixed; /* 让背景固定,不随页面滚动 */
  17. }
  18. .container {
  19. position: relative;
  20. width: 100%;
  21. margin: 0 auto;
  22. }
  23. .mod-new-reg-logo {
  24. position: relative;
  25. }
  26. .mod-new-reg-logo h3{
  27. position: absolute;
  28. top: 170px;
  29. left: 12%;
  30. color: white;
  31. z-index: 101;
  32. margin: 0; /* 去除默认的 margin */
  33. font-size: 35px; /* 增加字体大小 */
  34. }
  35. .mod-new-reg-logo p {
  36. position: absolute;
  37. top: 215px;
  38. left: 12%;
  39. color: white;
  40. z-index: 101;
  41. margin: 0; /* 去除默认的 margin */
  42. font-size: 19px; /* 增加字体大小 */
  43. line-height: 2; /* 设置行间距为字体大小的1.5倍,可以根据需要调整 */
  44. }
  45. /* 下面就是登录注册的表格形式,说句实话我没想到,背景直接就是表格 */
  46. table {
  47. position: absolute;
  48. top: 15%; /* 使表格顶部位于父元素的50%位置 */
  49. left: 70%; /* 使表格左侧位于父元素的50%位置 */
  50. background-color: rgba(255, 255, 255, 0.8); /* 使用 RGBA 值设置背景色,最后一个参数为透明度 */
  51. border-collapse: collapse;
  52. width: 270px;
  53. box-shadow: 0 0 10px rgba(0,0,0,0.1);
  54. border-radius: 30px; /* 设置边框的圆角半径为10px */
  55. }
  56. th, td {
  57. padding: 10px;
  58. text-align: left;
  59. }
  60. th {
  61. background-color: #f2f2f2;
  62. }
  63. input[type="text"], input[type="password"], input[type="email"] {
  64. width: calc(100% - 20px); /* 让输入框宽度占据表格的剩余空间 */
  65. padding: 8px;
  66. margin: 5px;
  67. border: 1px solid #ccc;
  68. border-radius: 3px;
  69. box-sizing: border-box;
  70. }
  71. input[type="submit"] {
  72. background-color: #4CAF50;
  73. color: white;
  74. border: none;
  75. padding: 10px 20px;
  76. text-align: center;
  77. text-decoration: none;
  78. display: inline-block;
  79. font-size: 16px;
  80. border-radius: 5px;
  81. cursor: pointer;
  82. }
  83. input[type="submit"]:hover {
  84. background-color: #45a049;
  85. }
  86. #lableRegister{
  87. background-color: rgba(255, 255, 255, 0.7); /* 使用 RGBA 值设置背景色,最后一个参数为透明度 */
  88. }
  89. </style>
  90. </head>
  91. <body>
  92. <div class="container">
  93. <div class="mod-new-reg-logo">
  94. <h3>用科技</h3>
  95. <p>让复杂的世界更简单</p>
  96. </div>
  97. <table>
  98. <tr>
  99. <th colspan="2" ><h2 id = "lableRegister">用户注册</h2></th>
  100. </tr>
  101. <tr>
  102. <td><label for="username">用户名:</label></td>
  103. <td><input type="text" id="username" name="username" required></td>
  104. </tr>
  105. <tr>
  106. <td><label for="email">邮箱:</label></td>
  107. <td><input type="email" id="email" name="email" required></td>
  108. </tr>
  109. <tr>
  110. <td><label for="password">密码:</label></td>
  111. <td><input type="password" id="password" name="password" required></td>
  112. </tr>
  113. <tr>
  114. <td><label for="confirm-password">确认密码:</label></td>
  115. <td><input type="password" id="confirm-password" name="confirm-password" required></td>
  116. </tr>
  117. <tr>
  118. <td colspan="2" style="text-align:center;"><input type="submit" value="注册"></td>
  119. </tr>
  120. </table>
  121. </div>
  122. </body>
  123. </html>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/寸_铁/article/detail/782876
推荐阅读
相关标签
  

闽ICP备14008679号