JSFiddle - React, Tailwind, and code Playground

by Abdul Ahmad

HTML

<div class='image-box'>
  <div class='text'>
    <div>
      <div class='title'>
        Try to focus on the simple things,
        and pursue what you enjoy. Finding peace
        can be easier than we think
      </div>
      <!-- <div class='author'>
        Ty - DudePerfect
      </div> -->
<!--       <div class='list'>
        <div class='col'>
          <div class='list-item'>
            - GO OUTDOORS
          </div>
          <div class='list-item'>
            - LEARN TO LAUGH
          </div>
          <div class='list-item'>
            - SLEEP WELL
          </div>
        </div>
        <div class='col'>
          <div class='list-item'>
            - LISTEN TO MUSIC
          </div>
          <div class='list-item'>
            - MAINTAIN A JOURNAL
          </div>
          <div class='list-item'>
            - EAT HEALTHIER
          </div>
        </div>
      </div> -->
    </div>
  </div>
</div>

CSS

.image-box {
  position: relative;
  width: 800px;
  height: 533px;
  background-image: url(https://static.pexels.com/photos/164889/pexels-photo-164889.jpeg);
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-color: #eee;
}

.text {
  position: absolute;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  top: 20px;
  left: 20px;
  border: 1px solid white;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  background: rgba(0, 0, 0, 0.4);
  font-family: ;
  font-size: 35px;
  box-sizing: border-box;
  padding: 100px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  text-align: center;
  font-family: sans-serif;
  line-height: 45px;
}

.title {
  // font-weight: bold;
}

.author {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-weight: 100;
  font-style: italic;
  font-size: 18px;
}

.list {
  font-family: sans-serif;
  font-size: 22px;
  margin-top: 40px;
  text-align: center;
}

.col {
  display: inline-block;
  vertical-align: top;
  width: 45%;
  text-align: left;
}

.list-item {
  display: inline-block;
  vertical-align: middle;
  padding: 10px 0;
}