博主信息
博文 56
粉丝 0
评论 4
访问量 48431
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
CSS:表单伪类-复习
异乡客
原创
916人浏览过
  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. </head>
  9. <body>
  10. <!--
  11. 伪类:
  12. 1.结构伪类:根据元素位置获取元素
  13. 2.状态伪类:根据状态来获取元素 -->
  14. <ul class="list">
  15. <li class="first">item1</li>
  16. <li>item2</li>
  17. <li>item3</li>
  18. <li>item4</li>
  19. <li>item5</li>
  20. <li>item6</li>
  21. <li>item7</li>
  22. <li>item8</li>
  23. </ul>
  24. <input type="text">
  25. <input type="text" disabled>
  26. <input type="radio" name="sex" id="m" value="0"><label for="m"></label>
  27. <input type="radio" name="sex" id="f" value="0"><label for="f"></label>
  28. <p>
  29. <button>提交</button>
  30. </p>
  31. <style>
  32. input:disabled{
  33. background-color: yellow;
  34. }
  35. input:enabled{
  36. background-color: cyan;
  37. }
  38. input:checked + label {
  39. color:red;
  40. }
  41. button {
  42. width:100px;
  43. height:30px;
  44. border: none;
  45. outline: none;
  46. background-color: seagreen;
  47. color:white;
  48. }
  49. button:hover{
  50. background-color: coral;
  51. cursor: pointer;
  52. }
  53. input:focus{
  54. background-color: red;
  55. }
  56. </style>
  57. </body>
  58. </html>
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学