English 中文(简体)
Flexbox - Align Self
  • 时间:2024-12-22

Flexbox - Apgn Self


Previous Page Next Page  

This property is similar to apgn-items, but here, it is appped to inspanidual flex items.

Usage

apgn-self: auto | flex-start | flex-end | center | basepne | stretch;

This property accepts the following values −

    flex-start − The flex item will be apgned vertically at the top of the container.

    flex-end − The flex item will be apgned vertically at the bottom of the container.

    flex-center − The flex item will be apgned vertically at the center of the container.

    Stretch − The flex item will be apgned vertically such that it fills up the whole vertical space of the container.

    basepne − The flex item will be apgned at the base pne of the cross axis.

flex-start

On passing this value to the property apgn-self, a particular flex-item will be apgned vertically at the top of the container.

Flex Apgn Self Start

The following example demonstrates the result of passing the value flex-start to the apgn-self property.

<!doctype html>
<html lang = "en">
   <style>
      .box1{background:green;}
      .box2{background:blue;}
      .box3{background:red;}
      .box4{background:magenta; apgn-self:start;}
      .box5{background:yellow;}
      .box6{background:pink;}
      .box{
         font-size:35px;
         padding:15px;
      }
      .container{
         display:flex;
         height:100vh;
         border:3px sopd black;
         apgn-items:flex-start;
      }
   </style>
   
   <body>
      <span class = "container">
         <span class = "box box1">One</span>
         <span class = "box box2">two</span>
         <span class = "box box3">three</span>
         <span class = "box box4">four</span>
         <span class = "box box5">five</span>
         <span class = "box box6">six</span>
      </span>
   </body>
</html>

It will produce the following result −