Advertisement
Patrikrizek

lesson-9-task-list

Dec 1st, 2022
1,089
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.12 KB | None | 0 0
  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>Task list</title>
  8.     <style>
  9.         * {
  10.             margin: 0;
  11.             padding: 0;
  12.             box-sizing: border-box;
  13.             font-family: sans-serif;
  14.         }
  15.  
  16.         body {
  17.             height: 100%;
  18.             height: 100vh;
  19.             width: 100%;
  20.             display: grid;
  21.             place-items: center;
  22.         }
  23.        
  24.         .container-list {
  25.             width: fit-content;
  26.             height: fit-content;
  27.             box-shadow: 0 5px 10px #ccc;
  28.             border-radius: 8px;
  29.             padding: 30px 20px 0 20px;
  30.             border: 1px solid #ddd;
  31.         }
  32.  
  33.         .list-title {
  34.             color: #0061ff;
  35.             text-align: center;
  36.         }
  37.  
  38.         .list {
  39.             margin: 40px;
  40.         }
  41.  
  42.         .list-item {
  43.             list-style: none;
  44.             display: flex;
  45.             align-items: center;
  46.             margin: 20px 5px;
  47.         }
  48.  
  49.         .list-item span {
  50.             position: relative;
  51.             width: 100%;
  52.             height: 20px;
  53.             margin-left: 20px;
  54.             padding-right: 20px;
  55.             color: #888;
  56.             border-right: 2px solid red;
  57.             transition: .2s ease-in-out;
  58.             text-align: left;
  59.             outline: none;
  60.             overflow: hidden;
  61.             white-space: nowrap;
  62.         }
  63.  
  64.         .list-item input[type="checkbox"] {
  65.             width: 20px;
  66.             height: 20px;
  67.         }
  68.  
  69.         input[type="checkbox"]:checked ~span {
  70.             color: #ccc;
  71.             border-right: 2px solid #28b545;
  72.         }
  73.  
  74.         span::after {
  75.             content: "";
  76.             position: absolute;
  77.             width: 0%;
  78.             height: 1px;
  79.             left: -4px;
  80.             top: 9px;
  81.             background: #ccc;
  82.             pointer-events: none;
  83.             transition: width .4s ease-out;
  84.         }
  85.        
  86.         input[type="checkbox"]:checked ~span:after {
  87.             width: 100%;
  88.         }
  89.     </style>
  90. </head>
  91. <body>
  92.     <section class="container-list">
  93.         <h1 class="list-title">My Tasks</h1>
  94.         <ul class="list">
  95.             <li class="list-item">
  96.                 <input type="checkbox">
  97.                 <span contenteditable="true">Task 1</span>
  98.             </li>
  99.             <li class="list-item">
  100.                 <input type="checkbox">
  101.                 <span contenteditable="true">Task 1</span>
  102.             </li>
  103.             <li class="list-item">
  104.                 <input type="checkbox">
  105.                 <span contenteditable="true">Task 1</span>
  106.             </li>
  107.             <li class="list-item">
  108.                 <input type="checkbox">
  109.                 <span contenteditable="true">Task 1</span>
  110.             </li>
  111.             <li class="list-item">
  112.                 <input type="checkbox">
  113.                 <span contenteditable="true">Task 1</span>
  114.             </li>
  115.         </ul>
  116.     </section>
  117. </body>
  118. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement