.myDiv {
  position: relative;
  z-index: 5;
  height: 250px;
  width: 300px;
  color: #000;
  font-size: 400%;
  padding: 20px;
}

.myDiv .bg {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: url(https://twcarter.com/wp-content/uploads/2021/09/Web-Design-2.png) center center;
  opacity: .4;
    width: 100%;
    height: 100%;
}