-3

My gender-reg (child of register-page isn't centering) it stays to the very left for some reason? I need it centered!

.register-page {
  width: 100%;
  height: 100%;
  margin: auto;
  text-align: center;

  ...

  .gender-reg {
    border: solid yellow;
    @include scale-to-screen((
      margin-bottom: 10px
    ))
  }

<div class="gender-reg">
  <selection-dropdown params="all: allGenderChoices"></selection-dropdown>
</div>

Basically what happens is everything else on the page is centered, except this element. I have zero idea as to why! Usually margin: auto centers it. I'm stuck!

joe
  • 11
  • 4

1 Answers1

0

A width of 100% will not center the element, Because there is no extra space.

If you set it to 50% then it will center the element within its parent.

Try this:

.register-page {
  width: 50%;
  height: 100%;
  margin: 0 auto;
  text-align: center;