.bar {
  position: relative;
  height: 3rem;
  background-color: whitesmoke;
  border: 1px solid silver;
}

.label {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  padding: 0 0.5rem;
  color: white;
  background-color: teal;
  translate: -50% 0;
}
