Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • 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
  • CSS Tutorial
  • CSS Exercises
  • CSS Interview Questions
  • CSS Selectors
  • CSS Properties
  • CSS Functions
  • CSS Examples
  • CSS Cheat Sheet
  • CSS Templates
  • CSS Frameworks
  • Bootstrap
  • Tailwind
  • CSS Formatter
Open In App
Next Article:
Tailwind CSS Grid Complete Reference
Next article icon

Tailwind CSS Flexbox Complete Reference

Last Updated : 18 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. The CSS flexbox is a vital feature to develop the frontend, there are four directions available in CSS so in Tailwind CSS all the properties are covered as in class form. we had alternative Tailwind CSS Flex classes for fast development of front-end like Tailwind CSS Flex Direction, Flex wrap, Flex, etc..

Tailwind CSS Class

Description

Flex DirectionIt established the main axis of the flexible item.
Flex WrapIt specifies whether flex items are forced into a single line or wrapped onto multiple lines.
FlexIt is used to set the length of flexible items.
Flex GrowThis class specifies how much the item will grow compared to other items inside that container.
Flex ShrinkThis class specifies how much the item will shrink compared to other items inside that container.
OrderIt renders flex and grid items in a different order than they appear in the DOM.

Below example will give you a brief idea about the Flexbox of Tailwind CSS:

Example:

HTML
<!DOCTYPE html> <html>  <head>     <title>Tailwind flex-1 Class</title>      <link href= "https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"         rel="stylesheet"> </head>  <body>     <h1 class="text-center text-green-600 text-5xl font-bold">         GeeksforGeeks     </h1>      <p class="text-center font-bold">Tailwind CSS flex-1 Class</p>       <div id="main" class="bg-green-200 border-4                         border-green-600 w-2/3 ml-32">         <p class="ml-2">This is the effect of flex-1:</p>           <div class="flex m-2 text-white">             <div class="bg-green-900 flex-1">                 Geeksforgeeks             </div>             <div class="bg-green-800 flex-1">                 Tailwind CSS             </div>         </div>         <p class="ml-2">                 This is the effect of flex-initial:         </p>           <div class="flex m-2 text-white">             <div class="bg-green-900 flex-initial">                 Geeksforgeeks             </div>             <div class="bg-green-800 flex-initial">                 A Computer Science for Geeks             </div>         </div>         <p class="ml-2">             This is the effect of flex-auto:         </p>           <div class="flex m-2 text-white">             <div class="bg-green-900 flex-auto">                 CSS             </div>             <div class="bg-green-800 flex-auto">                 Cascading Style Sheet             </div>         </div>         <p class="ml-2">                 This is the effect of flex-none:         </p>           <div class="flex m-2 text-white">             <div class="bg-green-900 flex-none">                 HTML             </div>             <div class="bg-green-800 flex-none">                 Hypertext Markup Language             </div>         </div>     </div> </body>  </html> 

Output:

Tailwind CSS Flexbox
Tailwind CSS Flexbox

Next Article
Tailwind CSS Grid Complete Reference

K

kartik
Improve
Article Tags :
  • Web Technologies
  • CSS

Similar Reads

    Tailwind CSS Layout Complete Reference
    Tailwind CSS is a utility-first CSS framework for rapid custom UI. It is a highly customizable, low-level CSS framework that gives you all of the building blocks that you need. As we know there are many CSS frameworks but people always choose the fast and easy framework to learn and use in the proje
    3 min read
    Tailwind CSS Flexbox Complete Reference
    Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. The CSS flexbox is a vital feature to develop the frontend, there are four directions available in CSS so in Tailwind CSS all the properties are covered as in class form. we had a
    2 min read
    Tailwind CSS Grid Complete Reference
    Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. Tailwind CSS Grid describes the number of properties that allow to design of the grid structure of the grid and control the placement of the grid.Tailwind CSS ClassDescriptionGrid
    2 min read
    Tailwind CSS Alignment Complete Reference
    Tailwind CSS is basically a utility first CSS framework for rapid custom UI. Tailwind CSS Alignment controls how the flex and grid items are aligned along with the container for fast front-end development. suppose Tailwind CSS Justify Content controlling how flex and grid items are positioned along
    2 min read
    Tailwind CSS Spacing Complete Reference
    Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. Tailwind CSS Spacing utilities manage and control the elements of padding, element's margin, and space between child elements.Tailwind CSS ClassDescriptionPaddingIt creates space
    1 min read
    Tailwind CSS Sizing Complete Reference
    Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. Tailwind CSS Sizing that set the size of elements like setting element width, height, min-max width, and min-max height.Tailwind CSS ClassDescriptionWidthIt sets the width of the
    1 min read
    Tailwind CSS Typography Complete Reference
    Tailwind is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. Tailwind CSS Typography, In which all style, properties, and spacing are covered in this class. For ex. Font family has multiple fonts as backups, font size has set the font size of t
    2 min read
    Tailwind CSS Backgrounds Complete Reference
    Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. Tailwind CSS Background, In which all the properties are covered in this class. it is controlling the background portion of the page like a background Image that can set one or mo
    2 min read
    Tailwind CSS Borders Complete Reference
    Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. Tailwind CSS Border utility settings the radius, width, color, opacity, etc., of element's borders. all the properties covered as in this class form.Tailwind CSS ClassDescriptionB
    2 min read
    Tailwind CSS Effects Complete Reference
    Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. Tailwind CSS Effects control the effects on elements. that provide classes to apply effects on elements like box-shadow, opacity/transparency.Tailwind CSS ClassDescriptionBox Shad
    1 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