Blogger Information
Blog 28
fans 0
comment 0
visits 13063
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
状态伪类与盒模型的五个核心属性实例演示
手机用户1594223549
Original
293 people have browsed it

一.状态伪类实例演示

1.输出成果
不点击提交的效果

点击提交时的效果

2.代码部分
  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. /* 可以输入状态下的文字提示 */
  10. input:enabled {
  11. color: #2b2;
  12. }
  13. /* 不可输入状态下的文字提示 */
  14. input:disabled {
  15. color: #aaa;
  16. }
  17. /* 点击提交按钮的文字效果 */
  18. button:active {
  19. color: red;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <form action="url_of_form">
  25. <fieldset>
  26. <label for="FirstField">用户名:</label>
  27. <input type="text" id="First" value="请输入用户名"><br>
  28. <label for="SecondField">密码:</label>
  29. <input type="text" id="Second" value="请输入密码" disabled="disabled"><br>
  30. <button>提交</button>
  31. </form>
  32. </fieldset>
  33. </body>
  34. </html>

二.盒模型的五个核心属性实例演示

1.输出成果

2.代码部分
  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. </head>
  9. <body>
  10. <div class="box">
  11. <h4>我爱我的国家中国</h4>
  12. <h4>我爱我的国家中国</h4>
  13. <h4>我爱我的国家中国</h4>
  14. <h4>我爱我的国家中国</h4>
  15. </div>
  16. <style>
  17. .box {
  18. /* 1.宽度 */
  19. width: 200px;
  20. /* 2.高度 */
  21. height: 200px;
  22. /* 3.边框 */
  23. border: 3px dashed green;
  24. /* 4.内边距 */
  25. padding: 5px 10px 5px;
  26. /* 5.外边距 */
  27. margin: 20px;
  28. }
  29. </style>
  30. </body>
  31. </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