Zendarino

cssfoundry

Feb 4th, 2024
8,128
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.59 KB | None | 0 0
  1. * {
  2.   box-sizing: border-box;
  3. }
  4.  
  5. /* Set a background color */
  6. body {
  7.   background-color: #474e5d;
  8.   font-family: Helvetica, sans-serif;
  9. }
  10.  
  11. /* The actual timeline (the vertical ruler) */
  12. .timeline {
  13.   position: relative;
  14.   max-width: 1200px;
  15.   margin: 0 auto;
  16. }
  17.  
  18. /* The actual timeline (the vertical ruler) */
  19. .timeline::after {
  20.   content: '';
  21.   position: absolute;
  22.   width: 6px;
  23.   background-color: white;
  24.   top: 0;
  25.   bottom: 0;
  26.   left: 50%;
  27.   margin-left: -3px;
  28. }
  29.  
  30. /* Container around content */
  31. .container {
  32.   padding: 10px 40px;
  33.   position: relative;
  34.   background-color: inherit;
  35.   width: 50%;
  36. }
  37.  
  38. /* The circles on the timeline */
  39. .container::after {
  40.   content: '';
  41.   position: absolute;
  42.   width: 25px;
  43.   height: 25px;
  44.   right: -17px;
  45.   background-color: white;
  46.   border: 4px solid #FF9F55;
  47.   top: 15px;
  48.   border-radius: 50%;
  49.   z-index: 1;
  50. }
  51.  
  52. /* Place the container to the left */
  53. .left {
  54.   left: 0;
  55. }
  56.  
  57. /* Place the container to the right */
  58. .right {
  59.   left: 50%;
  60. }
  61.  
  62. /* Add arrows to the left container (pointing right) */
  63. .left::before {
  64.   content: " ";
  65.   height: 0;
  66.   position: absolute;
  67.   top: 22px;
  68.   width: 0;
  69.   z-index: 1;
  70.   right: 30px;
  71.   border: medium solid white;
  72.   border-width: 10px 0 10px 10px;
  73.   border-color: transparent transparent transparent white;
  74. }
  75.  
  76. /* Add arrows to the right container (pointing left) */
  77. .right::before {
  78.   content: " ";
  79.   height: 0;
  80.   position: absolute;
  81.   top: 22px;
  82.   width: 0;
  83.   z-index: 1;
  84.   left: 30px;
  85.   border: medium solid white;
  86.   border-width: 10px 10px 10px 0;
  87.   border-color: transparent white transparent transparent;
  88. }
  89.  
  90. /* Fix the circle for containers on the right side */
  91. .right::after {
  92.   left: -16px;
  93. }
  94.  
  95. /* The actual content */
  96. .content {
  97.   padding: 20px 30px;
  98.   background-color: white;
  99.   position: relative;
  100.   border-radius: 6px;
  101. }
  102.  
  103. /* Media queries - Responsive timeline on screens less than 600px wide */
  104. @media screen and (max-width: 600px) {
  105. /* Place the timelime to the left */
  106.   .timeline::after {
  107.     left: 31px;
  108.   }
  109.  
  110. /* Full-width containers */
  111.   .container {
  112.     width: 100%;
  113.     padding-left: 70px;
  114.     padding-right: 25px;
  115.   }
  116.  
  117. /* Make sure that all arrows are pointing leftwards */
  118.   .container::before {
  119.     left: 60px;
  120.     border: medium solid white;
  121.     border-width: 10px 10px 10px 0;
  122.     border-color: transparent white transparent transparent;
  123.   }
  124.  
  125. /* Make sure all circles are at the same spot */
  126.   .left::after, .right::after {
  127.     left: 15px;
  128.   }
  129.  
  130. /* Make all right containers behave like the left ones */
  131.   .right {
  132.     left: 0%;
  133.   }
  134. }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment