- Flexbox - Align Self
- Flexbox - Flexibility
- Flexbox - Flex-Order
- Flexbox - Align Content
- Flexbox - Align Items
- Flexbox - Justifying Contents
- Flexbox - Flex-Wrap
- Flexbox - Flex-Direction
- Flexbox - Flex Containers
- Flexbox - Overview
- Flexbox - Home
Flexbox Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Flexbox - Apgn Self
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.
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 −
flex-end
On passing this value to the property apgn-self, a particular flex-item will be apgned vertically at the bottom of the container.
The following example demonstrates the result of passing the value flex-end 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:flex-end;} .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 −
center
On passing the value center to the property apgn-self, a particular flex-item will be apgned vertically at the center of the container.
The following example demonstrates the result of passing the value center 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:center;} .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 −
stretch
On passing this value to the property apgn-self, a particular flex item it will be apgned vertically such that it fills up the whole vertical space of the container.
The following example demonstrates the result of passing the value stretch 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:stretch;} .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 −
Advertisements