JSFiddle - React, Tailwind, and code Playground

by 규연 황

HTML

<ul class="step">
  <li>
    <span class="tit">step1</span>
    <span class="arrow"></span>
  </li>
  <li>
    <span class="tit">step2</span>
    <span class="arrow"></span>
  </li>
  <li>
    <span class="tit">step3</span>
    <span class="arrow"></span>
  </li>
</ul>

<ul class="step">
  <li>
    <span class="tit">step1</span>
    <span class="arrow"></span>
  </li>
  <li>
    <span class="tit">step2</span>
    <span class="arrow"></span>
</ul>

SCSS

* {
  box-sizing: border-box;
}

.step {
  display: flex;
  justify-content: center;
  margin: 0 50px 20px;
  background: #eee;
  text-align: center;
  li {
    position: relative;
    width: 33.3333%;
    height: 100px;
    padding: 0 30px 30px;
    background: #eee;
    .arrow {
      position: absolute;
      top: 22px;
      right: 0;
      z-index: 5;
      width: 10px;
      height: 10px;
      border-top: 3px solid red;
      border-right: 3px solid red;
      margin-right: -10px;
      transform: rotate(45deg);
    }
    .tit {
      position: relative;
      display: block;
      width: 50%;
      height: 10px;
      margin: auto;
      &:before {
        content: '';
        position: absolute;
        top: 20px;
        left: 50%;
        z-index: 1;
        width: 10px;
        height: 10px;
        border: 3px solid red;
        border-radius: 50%;
        background: #eee;
      }
    }
    &:before,
    &:after {
      content: '';
      position: absolute;
      top: 26px;
      width: 50%;
      
      border-top: 3px solid red;
    }
    &:before {
      left: 0;
      
    }
    &:after {
      right: 0;
    }
    &:first-child {
      &:before {
        border-top-style: dashed;
      }
    }
    &:last-child {
      &:after {
        border-top-style: dashed;
      }
      .arrow { 
        display: none;
      }
    }
  }
}