Align an element with the top of the parent element's font in Bootstrap 4

BootstrapWeb DevelopmentCSS Framework

Use align-text-top class to align an element with the top of the parent element's font.

Set the align-text-top class as −

<span class="align-text-top">
  Top Text

You can try to run the following code to implement the align-text 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-text-top">Top Text</span>
  <span class="align-text-bottom">Bottom Text</span>

Published on 10-Jul-2018 08:27:45