0

The blue background is 100% width and I just want it to be as wide as the text.

https://codepen.io/TylerL-uxai/pen/gRxMqG

.ux {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  background: #3c99cd;
  background: rgba(60, 153, 205, 0.85);
  color: white;
}
<div class="header-img-ux">
  <h2 class="ux">User Experience Design</h2>
</div>
Gerard
  • 15,418
  • 5
  • 30
  • 52
Tyler L
  • 835
  • 2
  • 16
  • 28

1 Answers1

2

.ux {
  margin:0;
  position: absolute;
  bottom: 0;
  left: 0;
}
.ux span {
  background: #3c99cd;
  background: rgba(60, 153, 205, 0.85);
  color: white;
}
<div class="header-img-ux">
  <h2 class="ux"><span>User Experience Design</span></h2>
</div>
Joel Glovacki
  • 813
  • 5
  • 14