• lable与input连用特殊动作效果


    1. 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>Documenttitle>
    7. <style>
    8. /*label 可以扩大触点 label中有一个for属性需要与id连用 */
    9. * {
    10. padding: 0;
    11. margin: 0;
    12. }
    13. input {
    14. display: none;
    15. }
    16. .container {
    17. height: 300px;
    18. width: 520px;
    19. display: flex;
    20. justify-content: space-between;
    21. margin: 150px auto;
    22. text-transform: uppercase;
    23. perspective: 1000px;
    24. }
    25. .label {
    26. display: flex;
    27. flex-direction: column;
    28. justify-content: space-between;
    29. }
    30. .label label {
    31. width: 100px;
    32. height: 90px;
    33. text-align: center;
    34. line-height: 90px;
    35. }
    36. .label label:hover {
    37. opacity: 0.8;
    38. }
    39. .label label:nth-child(1) {
    40. background: rebeccapurple;
    41. }
    42. .label label:nth-child(2) {
    43. background: yellowgreen;
    44. }
    45. .label label:nth-child(3) {
    46. background: palegreen;
    47. }
    48. .container .table_body {
    49. width: 400px;
    50. height: 300px;
    51. transform-style: preserve-3d;
    52. transform: rotateX(0deg);
    53. transition: all 1s ease;
    54. display: flex;
    55. justify-content: center;
    56. align-items: center;
    57. position: relative;
    58. }
    59. .container .table_body .table_content {
    60. position: absolute;
    61. width: 350px;
    62. height: 260px;
    63. display: flex;
    64. flex-direction: column;
    65. justify-content: center;
    66. text-align: center;
    67. color: #fff;
    68. }
    69. .container .table_body .table_content:nth-child(1) {
    70. background: rebeccapurple;
    71. transform: translateY(-130px) rotateX(90deg);
    72. }
    73. .container .table_body .table_content:nth-child(2) {
    74. background: yellowgreen;
    75. transform: translateZ(130px);
    76. }
    77. .container .table_body .table_content:nth-child(3) {
    78. background: palegreen;
    79. transform: translateY(130px) rotateX(-90deg);
    80. }
    81. #top:checked~.table_body {
    82. transform: rotateX(-90deg);
    83. }
    84. #middle:checked~.table_body {
    85. transform: rotateX(0deg);
    86. }
    87. #bottom:checked~.table_body {
    88. transform: rotateX(90deg);
    89. }
    90. style>
    91. head>
    92. <body>
    93. <div class="container">
    94. <input type="radio" name="tab" id="top">
    95. <input type="radio" name="tab" id="middle">
    96. <input type="radio" name="tab" id="bottom">
    97. <div class="table_body">
    98. <div class="table_content">
    99. <h3>toph3>
    100. div>
    101. <div class="table_content">
    102. <h3>middleh3>
    103. div>
    104. <div class="table_content">
    105. <h3>bottomh3>
    106. div>
    107. div>
    108. <div class="label">
    109. <label for="top">toplabel>
    110. <label for="middle">middlelabel>
    111. <label for="bottom">bottomlabel>
    112. div>
    113. div>
    114. body>
    115. html>

    lable与input连用特殊动作效果

     

  • 相关阅读:
    Vim命令总结
    C语言快速排序
    PIE-Engine APP:凉山州火灾高发地异常度分析系统
    Hbase解决ERROR: KeeperErrorCode = ConnectionLoss for /hbase/master报错
    【信号去噪】基于硬阈值、软阈值、半软阈值、Maxmin阈值、Garrote阈值小波变换实现心音去噪附matlab代码
    select并发服务器实现
    IBDP学生怎么写PS?
    Canal
    RabbitMQ(四):RabbitMQ高级特性
    自动驾驶算法逻辑框架中的三层特性——“多”重,“自”主,“深”化演进
  • 原文地址:https://blog.csdn.net/weixin_58474273/article/details/134387580