0

I have two p and one div.

I would that text get vertically centred.

<div class="toggle-area">
    <p>SEARCH BY</p>
    <div class="switch-inner">
        <p class ="toggle-inline">Business group</p>
        <div class="toggle-btn toggle-inline">
            <label class="switch">
              <input type="checkbox">
              <span class="slider round"></span>
            </label>
        </div>
        <p class="toggle-inline">Borrower</p>
    </div>
</div>

Here's the CSS :

.toggle-btn {
    margin: auto;
    text-align: center;
}
.toggle-area {
    padding-top:31px;
    padding-bottom: 30px;
    text-align: center;

}
.toggle-inline {
    display: inline;
    line-height: 100%;

}
.search-input {
    text-align: center;
    width: 400px;
    margin: auto
}
.switch-inner {
    vertical-align: middle;
}

The div contains a switch toggle input . the detailed css is here

Here's the actual behavior

And here's the actual behavior

And here's what I would

And here's what I would

infodev
  • 4,673
  • 17
  • 65
  • 138

0 Answers0