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 Align Content
Next article icon

Primer CSS Flexbox Example Components

Last Updated : 06 May, 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. Its approach to CSS is influenced by object-oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHub’s design system.

Primer CSS Flexbox Example Components is used to create the various components in Primer CSS using the flexbox classes. We can create the media object using the flexbox classes.

Primer CSS Flexbox Example Components:

  • Media object: This flexbox component is used to create the basic media object with text and images.
  • Responsive media object: This flexbox component is used to create the media object that would be responsive. It will be vertically centered on big screens and stacked on small viewports.

Primer CSS Flexbox Example Components Classes:

  • d-flex: This class is used to create the flexbox container.

Syntax:

<div class="d-flex">    <div class="border">        ...    </div>     <p>        ...     </p>  </div>

Example 1: This example demonstrates the implementation of Primer CSS Flexbox example components using a media object with 1 image.

HTML
<!DOCTYPE html> <html>  <head>     <title> Primer CSS Flexbox Example Components </title>     <link rel="stylesheet" href= "https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" />  </head>  <body>     <div class="text-center">         <h1 class="color-fg-success"> GeeksforGeeks </h1>         <h3> Primer CSS Flexbox Example Components </h3> <br>          <div class="border d-flex flex-items-center">             <div class="d-flex flex-justify-center">                 <img src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_200x200-min.png" />             </div>              <p class="pl-3">                 <strong> GeeksforGeeks: </strong> <br>                 A Computer Science portal for geeks.                 It contains well written, well thought                 and well explained computer science and                 programming articles.             </p>          </div>     </div> </body>  </html> 


Output:

 

Example 2: This example demonstrates the implementation of Primer CSS Flexbox example components with Responsive media object.

HTML
<!DOCTYPE html> <html>  <head>     <title> Primer CSS Flexbox Example Components </title>     <link rel="stylesheet" href= "https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" />  </head>  <body>     <div class="text-center">         <h1 class="color-fg-success"> GeeksforGeeks </h1>         <h3> Primer CSS Flexbox Example Components </h3> <br>          <h3> Responsive media object </h3>          <div class="m-2 border d-flex flex-column              flex-sm-row flex-sm-items-center">             <div class="p-2 d-flex flex-justify-center                  flex-sm-justify-start">                 <img style="max-width:120px;max-height:120px;" src=       "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190710102234/download3.png" />             </div>              <p class="pl-4 m-0">                 A Computer Science portal for geeks.                 It contains well written, well thought                 and well explained computer science and                 programming articles.                 A Computer Science portal for geeks.             </p>               <div class="d-flex flex-justify-center">                 <img style="max-width:80px; max-height:80px;"                       src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_200x200-min.png" />             </div>                          <div class="ml-sm-3 d-flex flex-justify-center">                 <svg class="octicon color-bg-success-emphasis                       color-fg-danger"                       viewBox="0 0 14 16"                       width="18" height="20" >                     <path d="M13.78 4.22a.75.75 0 010 1.06l-7.25                          7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0                          011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z">                     </path>                 </svg>             </div>         </div>     </div> </body> </html> 


Output:

 

Reference: https://primer.style/css/utilities/flexbox#example-components


Next Article
Primer CSS Flexbox Align Content
author
singh_teekam
Improve
Article Tags :
  • Web Technologies
  • CSS
  • Primer-CSS
  • Primer-CSS Utilities

Similar Reads

  • 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 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 Components
    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 that our patterns ar
    5 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
  • Primer CSS Flexbox Justify 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 Justify Content cl
    4 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
  • 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
  • Explain the concept of the CSS Flexbox
    The CSS Flexbox (Flexible Box) model is a layout mechanism that provides a straightforward and efficient way to design complex, responsive, and dynamic web layouts. Introduced to address challenges posed by traditional layout models, Flexbox simplifies the alignment and distribution of space among i
    2 min read
  • Complete Guide to CSS Flexbox
    Flexbox, short for Flexible Box Layout, is a one-dimensional layout method for aligning and distributing space among items in a container. It allows you to design layouts that adapt to different screen sizes, making it ideal for responsive web design. Flex Container: The parent element that holds fl
    8 min read
  • Primer CSS Flexbox Flex Direction
    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-direction is
    2 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