JSFiddle - React, Tailwind, and code Playground

by Abdul Ahmad

HTML

<div class='browser-wrap'>
  <div class='browser'>
    <div class='browser-header'>
      <div class='search-bar'>
        https://learnwithhomer.com
      </div>
    </div>
    <div class='browser-body'>
      <main class='website'>
        <div class='website-header'>
          header
        </div>
        <div class='website-body'>
          <div class='content-box'>

          </div>
          <div class='content-box gray'>

          </div>
          <div class='content-box'>

          </div>
          <div class='content-box gray'>

          </div>
        </div>
        <div class='website-footer'>
          footer
        </div>
      </main>
    </div>
  </div>
</div>

SCSS

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  color: #444;
  font-family: sans-serif;
  font-size: 14px;
}

.browser-wrap {
  padding: 50px;
  height: 100%;
}

.browser {
  border-radius: 10px;
  height: 100%;
  border: 1px solid #e9ecf0;
  box-shadow: 0 3px 10px 0 #dce0e6;
  display: flex;
  flex-direction: column;
}

.browser-header {
  flex-grow: 0;
  flex-shrink: 0;
  height: 40px;
  border-bottom: 1px solid #e9ecf0;
  display: flex;
  justify-content: center;
  align-items: center;
  
  .search-bar {
    width: 70%;
    height: 70%;
    border: 1px solid #e9ecf0;
    border-radius: 5px;
    display: flex;
    align-items: center;
    padding-left: 10px;
  }
}

.browser-body {
  flex-grow: 1;
  flex-shrink: 1;
  overflow-y: auto;
}

.website {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.website-header {
  flex-grow: 0;
  flex-shrink: 0;
  padding: 20px;
  border-bottom: 1px solid #e9ecf0;
  background: white;
  position: sticky;
  top: 0;
}

.website-body {
  flex-grow: 1;
  flex-shrink: 0;
}

.website-footer {
  flex-grow: 0;
  flex-shrink: 0;
  border-top: 1px solid #e9ecf0;
  padding: 20px;
}

.content-box {
  height: 200px;
  
  &.gray {
    background: #e9ecf0;
  }
}