练习1_表单控制.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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>Document</title>
  7. <style>
  8. /* css reset */
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. li {
  14. list-style: none;
  15. }
  16. /* 工具类 */
  17. .main-width {
  18. width: 1226px;
  19. margin: 0 auto;
  20. }
  21. body {
  22. background-color: rgb(249, 250, 251);
  23. }
  24. /* header start */
  25. header {
  26. height: 100px;
  27. background-color: #4F46E5;
  28. color: #fff;
  29. }
  30. header .main-width {
  31. display: flex;
  32. flex-direction: column;
  33. justify-content: center;
  34. height: 100%;
  35. }
  36. /* header end */
  37. /* content start */
  38. .content {
  39. padding-top: 80px;
  40. display: flex;
  41. justify-content: space-between;
  42. }
  43. .content aside h2 {
  44. margin-bottom: 30px;
  45. }
  46. .content aside {
  47. width: 480px;
  48. height: 830px;
  49. background-color: #fff;
  50. box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  51. border-radius: 10px;
  52. padding: 30px 20px;
  53. box-sizing: border-box;
  54. }
  55. .content aside p {
  56. margin: 10px 0;
  57. }
  58. .content aside input[type="range"] {
  59. width: 100%;
  60. background-color: rgb(229, 231, 235);
  61. /* -webkit-appearance:none; */
  62. }
  63. .content .color-content {
  64. display: flex;
  65. }
  66. .content .color-content input[type="color"] {
  67. width: 40px;
  68. height: 40px;
  69. margin-right: 10px;
  70. }
  71. .content .color-content input[type="text"] {
  72. width: 100px;
  73. height: 36px;
  74. flex-grow: 1;
  75. border: 1px solid rgb(209, 213, 219);
  76. border-radius: 5px;
  77. }
  78. .content .inp9 button {
  79. width: 100%;
  80. height: 50px;
  81. background-color: rgb(243, 244, 246);
  82. border: none;
  83. font-size: 20px;
  84. font-weight: bold;
  85. margin-top: 20px;
  86. }
  87. .content select {
  88. width: 100%;
  89. height: 36px;
  90. border: 1px solid rgb(209, 213, 219);
  91. border-radius: 5px;
  92. }
  93. .content article {
  94. width: 710px;
  95. height: 830px;
  96. background-color: #fff;
  97. box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  98. border-radius: 10px;
  99. padding: 30px 20px;
  100. box-sizing: border-box;
  101. }
  102. .content article .bg {
  103. background-color: #aaa;
  104. width: 100%;
  105. height: 650px;
  106. margin-top: 30px;
  107. border-radius: 10px;
  108. display: flex;
  109. justify-content: center;
  110. align-items: center;
  111. }
  112. .content article .box {
  113. width: 200px;
  114. height: 200px;
  115. background-color: gray;
  116. border:1px solid blue;
  117. display: flex;
  118. justify-content: center;
  119. align-items: center;
  120. }
  121. /* content end */
  122. </style>
  123. </head>
  124. <body>
  125. <div class="container">
  126. <header>
  127. <div class="main-width">
  128. <h1>交互式元素编辑器</h1>
  129. <p>通过表单控件实时修改元素样式和内容</p>
  130. </div>
  131. </header>
  132. <div class="content main-width">
  133. <aside>
  134. <h2>控制面板</h2>
  135. <div class="inp1">
  136. <p>元素大小: 200px</p>
  137. <input type="range" min="100" max="400">
  138. </div>
  139. <div class="inp2">
  140. <p>圆角大小: 10px</p>
  141. <input type="range" min="0" max="50">
  142. </div>
  143. <div class="inp3">
  144. <p>背景颜色</p>
  145. <div class="color-content">
  146. <input type="color">
  147. <input type="text">
  148. </div>
  149. </div>
  150. <div class="inp4">
  151. <p>元素文本</p>
  152. <div class="color-content">
  153. <input type="text">
  154. </div>
  155. </div>
  156. <div class="inp5">
  157. <p>边框样式</p>
  158. <div class="color-content">
  159. <input type="color">
  160. <input type="text">
  161. </div>
  162. </div>
  163. <div class="inp6">
  164. <p>边框样式</p>
  165. <select>
  166. <option value="solid">实线</option>
  167. <option value="dashed">虚线</option>
  168. <option value="dotted">点线</option>
  169. </select>
  170. </div>
  171. <div class="inp7">
  172. <p>边框宽度: 2px</p>
  173. <input type="range" min="1" max="10">
  174. </div>
  175. <div class="inp8">
  176. <p>阴影效果</p>
  177. <input type="checkbox" id="is-shadow">
  178. <label for="is-shadow">开启阴影</label>
  179. </div>
  180. <div class="inp9">
  181. <button>重置样式</button>
  182. </div>
  183. </aside>
  184. <article>
  185. <h2>预览区域</h2>
  186. <div class="bg">
  187. <div class="box">
  188. hello world
  189. </div>
  190. </div>
  191. </article>
  192. </div>
  193. <footer>
  194. </footer>
  195. </div>
  196. </body>
  197. </html>