JSFiddle - React, Tailwind, and code Playground

by ghostcode

HTML

<div class="box">
  <div class="sidebar">
    侧边栏
  </div>
  <div class="main">
    主要内容
  </div>
</div>

CSS

.box{
  display:flex;
  height:400px;
}

.sidebar{
  flex-basis:200px;
  /* min-width:200px; 确保当页面很小的时候,左侧变小*/
  flex-grow:0;
  background-color: #ddd;
}
.main{
  flex-grow:1;
  background-color: #999;
}