JSFiddle - React, Tailwind, and code Playground

HTML

<div id="box1" class="box box1">
  <div id="box2" class="box box2">
    <p class="p">Click the button below to save your edits.</p>
    
    <a href="#box1" class="btn btn1">Save</a>
    <a href="#box2" class="btn btn2">Save</a>
  </div>
</div>

CSS

@-webkit-keyframes overlayFade {
   0% { background: yellow; }
}

body {
  font: 14px/1.4 helvetica, arial, sans-serif;
}

.box1 {
  margin: 3em auto;
  width: 300px;
  background: #ddd;
}

.box2 {
  padding: 1em; /* padding must be inserted on the inside box */
}

.btn {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid black;
  border-radius: 2px;
  background: #eee;
  font: 600 13px helvetica;
  color: #333;
  text-shadow: 0 1px #fff;
  text-decoration: none;
  cursor: pointer;
}

.box1:target,
.box2:target {
  -webkit-animation: overlayFade 3s;
}

.btn2,
.box1:target .btn1 {
  display: none;
}

.box1:target .btn2 {
  display: inline-block;
}