Place an element in the middle of the parent element in Bootstrap 4

BootstrapWeb DevelopmentCSS Framework

Use align-middle class to place an element in the middle of the parent element.

To place an element in the middle −

<span class="align-middle">
  Middle Alignment

Let us seen an example to implement the align-middle class in Bootstrap 4 −


Live Demo

<!DOCTYPE html>
<html lang="en">
    <title>Bootstrap Example</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="">
    <script src=""></script>
    <script src=""></script>
    <div class="container">
      <p>This is demo text<p>
      <span class="align-baseline">Demo Baseline</span>
      <span class="align-top">Top Alignment</span>
      <span class="align-middle">Middle Alignment</span>
      <span class="align-bottom">Bottom Alignment</span>

Updated on 16-Jun-2020 09:02:33