-1

I'm having trouble aligning vertically my h3 element in my dim div.

I've tried some methods but none of them seemed to work.

This is what I have:

enter image description here

I want that "NEW WAVE" h3 to be centered vertically inside that faded box, I managed to align it horizontally with justify-content-center but the align-items-center for vertically is not working.

Im using Bootstrap 4 btw.

here's my HTML code:

<div class="container d-flex justify-content-center">
    <div class="dim">
        <div class="new-wave d-flex justify-content-center align-items-center">
            <h3>NEW WAVE</h3>
        </div>
    </div>
</div>
A.A Noman
  • 5,244
  • 9
  • 24
  • 46
Victor Blanco
  • 33
  • 1
  • 3

2 Answers2

1

Please try this.

.new-wave.d-flex.justify-content-center.align-items-center {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}
Abhishek Mishra
  • 192
  • 1
  • 7
0

Did you try to add this flex class to the parent container - .dim - ?