* {
  box-sizing: border-box;
}
    
/* ラジオボタンは非表示 */
input[type="radio"] {
  display: none;
}

.tab {
  background: burlywood;
  width: 800px;
  max-width: 100%;
  margin: auto;
  display: flex;
  flex-flow: wrap;
}

.tab-item {
  justify-content: center;
  width: 30%;
  height: 50px;
  background: aquamarine;
  display: block;
  flex-grow: 1;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  order: -1;/* タブメニューは一番上に表示する */
  
  /* 下線以外をつける */
  border-top: 1px solid red;
  border-left: 1px solid red;
  border-right: 1px solid red;
}

.tab-item:not(:first-of-type) {
  border-left: none;
}

/* アクティブなタブの背景色と文字色を変える */
.tab-input:checked + .tab-item {
  background: Blue;
  color: white;
}
    
/* コンテンツは原則非表示 */
.tab-content {
  background: skyblue;
  width: 100%;
  height: 200px;
  display: none;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  border: 1px solid skyblue;
}

/* ラジオボタンがチェックされているコンテンツだけは表示 */
.tab-input:checked + .tab-item + .tab-content {
  display: flex;
}
div {
    background: #feeeee;
    width: 800px;
    padding: 10px;
    text-align: left;
    border: 1px solid #cccccc;
  }

