Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<head>
<style> 
#main {
  width: 220px;
  height: 300px;
  border: 1px solid black;
  display: flex;
  align-items: flex-start;
}
#main div {
  flex: 1;
}
#myBlueDiv {
  align-self: center;
}
</style>
</head>
<body>
<div id="main">
  <div style="background-color:coral;">RED</div>
  <div style="background-color:lightblue;" id="myBlueDiv">BLUE</div>  
  <div style="background-color:lightgreen;">Green div with more content.</div>
</div>
<p><b>Note:</b> The align-self property overrides the container's align-items property.</p>
<p><b>Note:</b> Internet Explorer 10 and earlier versions do not support the align-self property.</p>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.php?filename=trycss3_align-self by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:34:40 GMT -->
</html>