Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Bootstrap
  • Tailwind
  • Bulma
  • Foundation
  • Primer
  • Spectre
  • Onsen UI
  • Semantic UI
  • Pure CSS
  • Materialize
  • SASS
  • LESS
  • Blaze UI
  • CSS Frameworks
  • Color Picker
  • CSS
  • CSS Formatter
  • Web Technology
Open In App
Next Article:
Primer CSS Flexbox
Next article icon

Primer CSS Flexbox Align Self

Last Updated : 25 Apr, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other.

Primer CSS Flexbox Align Self classes are used to adjust the alignment of an individual flex item on the cross axis. If there is any align-item property applied then these classes will be over-written to those properties. There are six types of Align Self classes in Primer CSS as described below.

Primer CSS Flexbox Align Self Classes:

  • flex-self-auto: This class is used to align specific flex items according to the parent.
  • flex-self-start: This class is used to align specific flex items to the start of the cross axis.
  • flex-self-end: This class is used to align specific flex items to the end of the cross axis.
  • flex-self-center: This class is used to align specific flex items to the center of the cross axis.
  • flex-self-baseline: This class is used to align specific flex items to the baseline of the cross axis.
  • flex-self-stretch: This class is used to stretch specific flex items from the start of the cross-axis to the end of the cross axis.

Syntax:

<div class="border d-flex ">      <div class="Flexbox-Align-Self-Class">            ...      </div>      ...  </div>

Example 1: This example demonstrates the use of Primer CSS Flexbox Align Self using flex-self-start, flex-self-end, and flex-self-center classes.

HTML
<!DOCTYPE html> <html>  <head>     <title> Primer CSS Flexbox Align Self </title>     <link rel="stylesheet" href= "https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" /> </head>    <body>     <h1 class="color-fg-success text-center">          GeeksforGeeks      </h1>     <h4 class="text-center font-bold">         Primer CSS Flexbox Align Self     </h4>      <strong>Flexbox flex-self-start Class:</strong>     <br>     <div class="border d-flex m-2 "           style="min-height: 150px;">           <div class="p-5 border flex-self-start                       color-bg-accent-emphasis">           Flex item 1         </div>           <div class="p-5 border color-bg-success-emphasis">           Flex item 2         </div>           <div class="p-5 border color-bg-danger-emphasis">           Flex item 3         </div>     </div>      <strong>Flexbox flex-self-end Class:</strong>     <br>     <div class="border d-flex m-2 "           style="min-height: 150px;">           <div class="p-5 border flex-self-end                       color-bg-accent-emphasis">           Flex item 1         </div>           <div class="p-5 border color-bg-success-emphasis">           Flex item 2         </div>           <div class="p-5 border color-bg-danger-emphasis">           Flex item 3         </div>     </div>      <strong>Flexbox flex-self-center Class:</strong>     <br>     <div class="border d-flex m-2 "           style="min-height: 150px;">         <div class="p-5 border flex-self-center                     color-bg-accent-emphasis">             Flex item 1         </div>         <div class="p-5 border color-bg-success-emphasis">             Flex item 2         </div>         <div class="p-5 border color-bg-danger-emphasis">             Flex item 3         </div>     </div> </body>  </html> 

Output:

Primer CSS Flexbox Align Self

Example 2: This example demonstrates the use of Primer CSS Flexbox Align Self using flex-self-baseline, flex-self-stretch, and flex-self-auto classes.

HTML
<!DOCTYPE html> <html>  <head>     <title> Primer CSS Flexbox Self Items </title>     <link rel="stylesheet" href= "https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" /> </head>    <body>     <h1 class="color-fg-success text-center">          GeeksforGeeks      </h1>     <h4 class="text-center font-bold">         Primer CSS Flexbox Self Items     </h4>      <strong>Flexbox flex-self-baseline Class:</strong>     <br>     <div style="min-height: 150px;"           class="border d-flex flex-items-end m-2">         <div class="p-5 border color-bg-accent-emphasis                      flex-self-baseline">             Flex item 1         </div>         <div class="p-5 border color-bg-success-emphasis">             Flex item 2         </div>         <div class="p-5 border color-bg-danger-emphasis">             Flex item 3         </div>     </div>      <strong>Flexbox flex-self-stretch Class:</strong>     <br>     <div style="min-height: 150px;"           class="border d-flex flex-items-end m-2">         <div class="p-5 border color-bg-accent-emphasis                      flex-self-stretch">             Flex item 1         </div>         <div class="p-5 border color-bg-success-emphasis">             Flex item 2         </div>         <div class="p-5 border color-bg-danger-emphasis">             Flex item 3         </div>     </div>          <strong>Flexbox flex-self-auto Class:</strong>     <br>     <div style="min-height: 150px;"           class="border d-flex flex-items-end m-2">         <div class="p-5 border color-bg-accent-emphasis                      flex-self-auto">             Flex item 1         </div>         <div class="p-5 border color-bg-success-emphasis">             Flex item 2         </div>         <div class="p-5 border color-bg-danger-emphasis">             Flex item 3         </div>     </div> </body>  </html> 

Output:

Primer CSS Flexbox Align Self

Reference: https://primer.style/css/utilities/flexbox#align-self


Next Article
Primer CSS Flexbox

S

skyridetim
Improve
Article Tags :
  • Web Technologies
  • CSS
  • Primer-CSS
  • Primer-CSS Utilities

Similar Reads

  • Primer CSS Flexbox Align Items
    Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Primer CSS Flexbox Align Items used t
    3 min read
  • Primer CSS Flexbox Align Content
    Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Primer CSS Flexbox Align Content is u
    4 min read
  • Primer CSS Flexbox
    Primer CSS is a free open-source CSS framework based on principles that set the foundation for basic design elements like spacing, typeface, and color. This rigorous approach ensures that our patterns are consistent and interoperable. Primer CSS Flexbox: Flex container: Flex Container is used to mak
    6 min read
  • Primer CSS Flexbox Bugs
    Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Flexbox is the flexible box that will
    3 min read
  • CSS align-self Property
    The align-self property in CSS is used to align the selected items in the flexible container in many different manners such as flex-end, center, flex-start, etc.  Syntax: align-self: auto|normal|self-start|self-end|stretch|center |baseline, first baseline, last baseline|flex-start |flex-end|baseline
    5 min read
  • Primer CSS Flexbox Flex Container
    Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Primer CSS Flexbox Flex Container is
    2 min read
  • Primer CSS Flexbox Flex
    Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Primer CSS Flexbox Flex classes are u
    3 min read
  • CSS Flexbox and Its Properties
    CSS Flexbox, or Flexible Box Layout, is the layout model designed to create flexible and responsive layout structures without using float or positioning. By applying display: flex to a parent container, it becomes a flex container, and its children become flex items. This allows control over the ite
    3 min read
  • Primer CSS Flexbox Grids
    Primer CSS is a free open-source CSS framework that is built with the GitHub design system to provide support to the broad spectrum of Github websites. It creates the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are ste
    3 min read
  • Primer CSS Flexbox Order
    Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Primer CSS Flexbox Order classes are
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences