Skip to content
Related Articles

Related Articles

How to align-self element positioned at the baseline of the container ?

View Discussion
Improve Article
Save Article
  • Last Updated : 06 Apr, 2021

In this article, we will learn how to self-align an element at the baseline of the container. This can be achieved using the CSS align-self property. This property is a sub-part of the Flexbox module and helps to override the alignment of the specific flex item, defined by the container. The baseline property can be used to align the element at the baseline of the container. Any other alignment can also be possible using the same approach.



      #flex-container {
        display: flex;
        background-color: #f1f1f1;
        width: 50%;
        height: 250px;
      #flex-container > div {
        background-color: rgb(33, 246, 107);
        color: "#000000";
        width: 100px;
        margin: 15px;
        text-align: center;
        line-height: 75px;
        font-size: 35px;
    <div id="flex-container">
      <!-- Self align the div to baseline -->
      <div style="align-self: baseline">B</div>


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!