SlideShare a Scribd company logo
Flexbox
(Flexible Box Layout)
The CSS3 Flexible Box, or flexbox, is a
layout mode providing for the arrangement
of elements on a page such that the
elements behave predictably when the page
layout must accommodate different screen
sizes and different display devices.
Mozilla Developer Network
What is Flexbox?
Designed to provide a better way to lay out, align, and
distribute space among items in a container - even when
dynamic.
Flexbox is a CSS layout mode designed to ensure that
elements behave predictably in different screen sizes and
devices. … it creates Intelligent boxes.
Easily Defined in CSS and markup (incl. media queries).
Directionally agnostic. (block = vertically-based & inline
= horizontally-based)
Best used for smaller modules over broader layout
“Old” and “New” syntax
Oddly, the syntax has changed since initial conception -
which has resulted in common references to “old” and “new”
versions.
Weaving together the two, (and in-betweens) provides decent
browser support - especially for order-controlled grids
▪ Chris Coyier (2013)
Requires additional code and prefixed code when authoring
for best results. … consider a js library (autoprefixer)
Examples
NEW: display: flex;
TWEEN: display; -ms-flexbox;
OLD: display: box;
Core Concepts
Flexbox consists of:
▪Flex Containers
▪Flex Items
Flex Container
Declared on an element using the display property
display: flex or display: inline-flex
Flex Item
Flex items are positioned inside of a flex container along
a “flex line”. By default 1 flex line per flex container.
contaner
< items
Core Concepts
Flex Line (axis, rope)
Flex items are laid out in a single “line” (default) or on
several “lines” according to the flex-wrap property. No
longer think about top-to-bottom or left-to-right. Abandon
rows/columns thinking.
direction orientation
Core Concepts
Flex Line
In addition to Alignment, Orientation and Direction, flex
lines can be reordered! This is huge. We can now
structure our HTML for semantics, accessibility, and SEO
.item { order: <integer>; }
order
By default, flex
items are laid
out in source
order
Core Concepts
Nested Flex Lines
Each flexbox layout (box) can contain another set that is
on their own line.
Nested flexboxes
Core Concepts
flex-wrap
By default all flex items will try to fit together into one
line. This can be changed and direction can be modified
using the flex-wrap property.
.container {
flex-wrap: wrap; nowrap | wrap | wrap reverse
}
Core Concepts
flex-grow
Defines the ability for a flex item to grow if needed.
(unitless values serve as proportion) An item set at 2
would be twice as big as an item set at 1.
.item {
flex-grow: <number>; /* default = 0 */
}
flex-shrink
Defines the ability for a flex item to shrink if needed.
.item {
flex-shrink: <number>; /* default = 0 */
}
Core Concepts
flex-basis
Defines the default size of an element - before remaining
space is distributed. Length or keyword values.
.item {
flex-basis: <number>;
}
If set to 0, the extra space around it is not factored in.
If set to auto (keyword), the extra space is distributed by
its flex-grow value
Core Concepts
flex (shortcut)
Combines flex-grow, flex-shrink (opt) and flex-basis (opt).
Default = 0 1 auto
RECOMMENDED over individual properties.
.item {
flex: 1 0 0;
}
1
Let’s look at some Code
To the text-editor!
Some other examples (that I didn’t have time to build)
▪ https://dl.dropboxusercontent.com/u/444684/flexbox/flexbox1.html
▪ https://dl.dropboxusercontent.com/u/444684/flexbox/flexbox2.html
▪ https://dl.dropboxusercontent.com/u/444684/flexbox/flexbox3.html
Browser Adoption
Can I Use? - caniuse.com
Flexbox is the current new and now way of
thinking about CSS layout - but not the end.
Historic and current layout practices
▪ Table based layouts
▪ Float based layouts (CSS1)
▪ Positioning (CSS2)
▪ Flexbox “This is real layout. It’s not a hack” - Jeremy Keith
▫ Flexbox (old)
▫ Flexbox (mid/transitional)
▫ Flexbox (standard/final)
The future is coming ‘soon’ and will likely build upon the
flexbox model and techniques.
▪ Grid Layout (ie10 has adopted an early specification)
▪ Regions and Exclusions (Adobe initiative)
● https://developer.mozilla.org/en-
US/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes
● http://www.sitepoint.com/are-we-ready-to-use-flexbox/
● https://css-tricks.com/using-flexbox/
● http://caniuse.com/#feat=flexbox
● https://css-tricks.com/snippets/css/a-guide-to-flexbox/
● https://www.smashingmagazine.com/2013/05/centering-elements-with-flexbox/
● https://www.smashingmagazine.com/2015/08/flexible-future-for-web-design-with-flexbox/
References

More Related Content

What's hot (20)

Flex box
Flex boxFlex box
Flex box
Harish Karthick
 
Introduction to flexbox
Introduction  to  flexboxIntroduction  to  flexbox
Introduction to flexbox
Jyoti Gautam
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
casestudyhelp
 
Intro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS PropertyIntro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS Property
Adam Soucie
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Andres Baravalle
 
Js ppt
Js pptJs ppt
Js ppt
Rakhi Thota
 
javascript objects
javascript objectsjavascript objects
javascript objects
Vijay Kalyan
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations
Rob LaPlaca
 
Css Ppt
Css PptCss Ppt
Css Ppt
Hema Prasanth
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
abhilashagupta
 
Html list
Html listHtml list
Html list
sayed fathey
 
Introduction into ES6 JavaScript.
Introduction into ES6 JavaScript.Introduction into ES6 JavaScript.
Introduction into ES6 JavaScript.
boyney123
 
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
1amitgupta
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Amit Tyagi
 
Css
CssCss
Css
shanmuga rajan
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 
Java script
Java scriptJava script
Java script
Sadeek Mohammed
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
 
The Power of CSS Flexbox
The Power of CSS FlexboxThe Power of CSS Flexbox
The Power of CSS Flexbox
freshlybakedpixels
 
Introduction to flexbox
Introduction  to  flexboxIntroduction  to  flexbox
Introduction to flexbox
Jyoti Gautam
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
casestudyhelp
 
Intro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS PropertyIntro to Flexbox - A Magical CSS Property
Intro to Flexbox - A Magical CSS Property
Adam Soucie
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Andres Baravalle
 
javascript objects
javascript objectsjavascript objects
javascript objects
Vijay Kalyan
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations
Rob LaPlaca
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
abhilashagupta
 
Introduction into ES6 JavaScript.
Introduction into ES6 JavaScript.Introduction into ES6 JavaScript.
Introduction into ES6 JavaScript.
boyney123
 
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
1amitgupta
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Amit Tyagi
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
Salman Memon
 

Similar to CSS Flexbox (flexible box layout) (20)

Flexbox Will Shock You!
Flexbox Will Shock You!Flexbox Will Shock You!
Flexbox Will Shock You!
Scott Vandehey
 
Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?
jameswillweb
 
flexbox report
flexbox reportflexbox report
flexbox report
LearningTech
 
Using Flexbox Today (Frontier Conf 2016)
Using Flexbox Today (Frontier Conf 2016)Using Flexbox Today (Frontier Conf 2016)
Using Flexbox Today (Frontier Conf 2016)
Zoe Gillenwater
 
A complete guide to flexbox
A complete guide to flexboxA complete guide to flexbox
A complete guide to flexbox
Bytes Technolab Inc.
 
Flex Web Development.pdf
Flex Web Development.pdfFlex Web Development.pdf
Flex Web Development.pdf
SEO expate Bangladesh Ltd
 
Is Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconfIs Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconf
jameswillweb
 
Show & tell - Flex in flux
Show & tell - Flex in fluxShow & tell - Flex in flux
Show & tell - Flex in flux
Dan Dineen
 
CSS3 Flexbox & Responsive Design
CSS3 Flexbox & Responsive DesignCSS3 Flexbox & Responsive Design
CSS3 Flexbox & Responsive Design
Arash Milani
 
Using Flexbox Today (Generate Sydney 2016)
Using Flexbox Today (Generate Sydney 2016)Using Flexbox Today (Generate Sydney 2016)
Using Flexbox Today (Generate Sydney 2016)
Zoe Gillenwater
 
#4 HTML & CSS [know-how]
#4 HTML & CSS [know-how]#4 HTML & CSS [know-how]
#4 HTML & CSS [know-how]
Dalibor Gogic
 
Understanding the flex layout
Understanding the flex layoutUnderstanding the flex layout
Understanding the flex layout
Barak Drechsler
 
Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)
Zoe Gillenwater
 
Putting Flexbox into Practice
Putting Flexbox into PracticePutting Flexbox into Practice
Putting Flexbox into Practice
Zoe Gillenwater
 
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
Kobkrit Viriyayudhakorn
 
Intro to Flexbox with Real Word Examples
Intro to Flexbox with Real Word ExamplesIntro to Flexbox with Real Word Examples
Intro to Flexbox with Real Word Examples
Jennifer Bland
 
gdg_workshop 5 on web development HTML & CSS
gdg_workshop 5 on web development HTML & CSSgdg_workshop 5 on web development HTML & CSS
gdg_workshop 5 on web development HTML & CSS
SaniyaKhan484230
 
Understanding flexbox
Understanding flexboxUnderstanding flexbox
Understanding flexbox
mustafa sarac
 
Layout with flexbox
Layout with flexboxLayout with flexbox
Layout with flexbox
The Level Consulting, Ltd.
 
CSS3 Flex Layout
CSS3 Flex LayoutCSS3 Flex Layout
CSS3 Flex Layout
Neha Sharma
 
Flexbox Will Shock You!
Flexbox Will Shock You!Flexbox Will Shock You!
Flexbox Will Shock You!
Scott Vandehey
 
Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?
jameswillweb
 
Using Flexbox Today (Frontier Conf 2016)
Using Flexbox Today (Frontier Conf 2016)Using Flexbox Today (Frontier Conf 2016)
Using Flexbox Today (Frontier Conf 2016)
Zoe Gillenwater
 
Is Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconfIs Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconf
jameswillweb
 
Show & tell - Flex in flux
Show & tell - Flex in fluxShow & tell - Flex in flux
Show & tell - Flex in flux
Dan Dineen
 
CSS3 Flexbox & Responsive Design
CSS3 Flexbox & Responsive DesignCSS3 Flexbox & Responsive Design
CSS3 Flexbox & Responsive Design
Arash Milani
 
Using Flexbox Today (Generate Sydney 2016)
Using Flexbox Today (Generate Sydney 2016)Using Flexbox Today (Generate Sydney 2016)
Using Flexbox Today (Generate Sydney 2016)
Zoe Gillenwater
 
#4 HTML & CSS [know-how]
#4 HTML & CSS [know-how]#4 HTML & CSS [know-how]
#4 HTML & CSS [know-how]
Dalibor Gogic
 
Understanding the flex layout
Understanding the flex layoutUnderstanding the flex layout
Understanding the flex layout
Barak Drechsler
 
Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)
Zoe Gillenwater
 
Putting Flexbox into Practice
Putting Flexbox into PracticePutting Flexbox into Practice
Putting Flexbox into Practice
Zoe Gillenwater
 
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
Kobkrit Viriyayudhakorn
 
Intro to Flexbox with Real Word Examples
Intro to Flexbox with Real Word ExamplesIntro to Flexbox with Real Word Examples
Intro to Flexbox with Real Word Examples
Jennifer Bland
 
gdg_workshop 5 on web development HTML & CSS
gdg_workshop 5 on web development HTML & CSSgdg_workshop 5 on web development HTML & CSS
gdg_workshop 5 on web development HTML & CSS
SaniyaKhan484230
 
Understanding flexbox
Understanding flexboxUnderstanding flexbox
Understanding flexbox
mustafa sarac
 
CSS3 Flex Layout
CSS3 Flex LayoutCSS3 Flex Layout
CSS3 Flex Layout
Neha Sharma
 

Recently uploaded (20)

Offensive Security Penetration Testing
Offensive Security Penetration Testing        Offensive Security Penetration Testing
Offensive Security Penetration Testing
Purple Box
 
Improving Engagement with CRM Software for Instance Agents
Improving Engagement with CRM Software for Instance AgentsImproving Engagement with CRM Software for Instance Agents
Improving Engagement with CRM Software for Instance Agents
Insurance Tech Services
 
Salesforce Experience Cloud Consulting.pdf
Salesforce Experience Cloud Consulting.pdfSalesforce Experience Cloud Consulting.pdf
Salesforce Experience Cloud Consulting.pdf
VALiNTRY360
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdfBoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Optimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing SystemsOptimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing Systems
Insurance Tech Services
 
Oliveira2024 - Combining GPT and Weak Supervision.pdf
Oliveira2024 - Combining GPT and Weak Supervision.pdfOliveira2024 - Combining GPT and Weak Supervision.pdf
Oliveira2024 - Combining GPT and Weak Supervision.pdf
GiliardGodoi1
 
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
Philip Schwarz
 
Key Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker SoftwareKey Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker Software
Insurance Tech Services
 
And overview of Nasdanika Models and their applications
And overview of Nasdanika Models and their applicationsAnd overview of Nasdanika Models and their applications
And overview of Nasdanika Models and their applications
Pavel Vlasov
 
Multiple Platforms of Unity Game Development.pdf
Multiple Platforms of Unity Game Development.pdfMultiple Platforms of Unity Game Development.pdf
Multiple Platforms of Unity Game Development.pdf
Nova Carter
 
Top 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdfTop 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdf
SatishKumar2651
 
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjaraswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
muhammadalikhanalikh1
 
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdfICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
M. Luisetto Pharm.D.Spec. Pharmacology
 
Top 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdfTop 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdf
LL Technolab
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
AI Ethics: Integrating Transparency, Fairness, and Privacy in AI Development
AI Ethics: Integrating Transparency, Fairness, and Privacy in AI DevelopmentAI Ethics: Integrating Transparency, Fairness, and Privacy in AI Development
AI Ethics: Integrating Transparency, Fairness, and Privacy in AI Development
Petar Radanliev
 
Software Quality Assurance (Models).pptx
Software Quality Assurance (Models).pptxSoftware Quality Assurance (Models).pptx
Software Quality Assurance (Models).pptx
HibbaTabeer
 
What's-New-with-BoxLang-Brad Wood.pptx.pdf
What's-New-with-BoxLang-Brad Wood.pptx.pdfWhat's-New-with-BoxLang-Brad Wood.pptx.pdf
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Ortus Solutions, Corp
 
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
gauravvmanchandaa200
 
Why-Choose-an-Authorised-Microsoft-Reseller.pptx
Why-Choose-an-Authorised-Microsoft-Reseller.pptxWhy-Choose-an-Authorised-Microsoft-Reseller.pptx
Why-Choose-an-Authorised-Microsoft-Reseller.pptx
Michael cole
 
Offensive Security Penetration Testing
Offensive Security Penetration Testing        Offensive Security Penetration Testing
Offensive Security Penetration Testing
Purple Box
 
Improving Engagement with CRM Software for Instance Agents
Improving Engagement with CRM Software for Instance AgentsImproving Engagement with CRM Software for Instance Agents
Improving Engagement with CRM Software for Instance Agents
Insurance Tech Services
 
Salesforce Experience Cloud Consulting.pdf
Salesforce Experience Cloud Consulting.pdfSalesforce Experience Cloud Consulting.pdf
Salesforce Experience Cloud Consulting.pdf
VALiNTRY360
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdfBoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Optimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing SystemsOptimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing Systems
Insurance Tech Services
 
Oliveira2024 - Combining GPT and Weak Supervision.pdf
Oliveira2024 - Combining GPT and Weak Supervision.pdfOliveira2024 - Combining GPT and Weak Supervision.pdf
Oliveira2024 - Combining GPT and Weak Supervision.pdf
GiliardGodoi1
 
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
Philip Schwarz
 
Key Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker SoftwareKey Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker Software
Insurance Tech Services
 
And overview of Nasdanika Models and their applications
And overview of Nasdanika Models and their applicationsAnd overview of Nasdanika Models and their applications
And overview of Nasdanika Models and their applications
Pavel Vlasov
 
Multiple Platforms of Unity Game Development.pdf
Multiple Platforms of Unity Game Development.pdfMultiple Platforms of Unity Game Development.pdf
Multiple Platforms of Unity Game Development.pdf
Nova Carter
 
Top 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdfTop 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdf
SatishKumar2651
 
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjaraswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
muhammadalikhanalikh1
 
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdfICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
M. Luisetto Pharm.D.Spec. Pharmacology
 
Top 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdfTop 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdf
LL Technolab
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
AI Ethics: Integrating Transparency, Fairness, and Privacy in AI Development
AI Ethics: Integrating Transparency, Fairness, and Privacy in AI DevelopmentAI Ethics: Integrating Transparency, Fairness, and Privacy in AI Development
AI Ethics: Integrating Transparency, Fairness, and Privacy in AI Development
Petar Radanliev
 
Software Quality Assurance (Models).pptx
Software Quality Assurance (Models).pptxSoftware Quality Assurance (Models).pptx
Software Quality Assurance (Models).pptx
HibbaTabeer
 
What's-New-with-BoxLang-Brad Wood.pptx.pdf
What's-New-with-BoxLang-Brad Wood.pptx.pdfWhat's-New-with-BoxLang-Brad Wood.pptx.pdf
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Ortus Solutions, Corp
 
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
Risk Management in Software Projects: Identifying, Analyzing, and Controlling...
gauravvmanchandaa200
 
Why-Choose-an-Authorised-Microsoft-Reseller.pptx
Why-Choose-an-Authorised-Microsoft-Reseller.pptxWhy-Choose-an-Authorised-Microsoft-Reseller.pptx
Why-Choose-an-Authorised-Microsoft-Reseller.pptx
Michael cole
 

CSS Flexbox (flexible box layout)

  • 2. The CSS3 Flexible Box, or flexbox, is a layout mode providing for the arrangement of elements on a page such that the elements behave predictably when the page layout must accommodate different screen sizes and different display devices. Mozilla Developer Network
  • 3. What is Flexbox? Designed to provide a better way to lay out, align, and distribute space among items in a container - even when dynamic. Flexbox is a CSS layout mode designed to ensure that elements behave predictably in different screen sizes and devices. … it creates Intelligent boxes. Easily Defined in CSS and markup (incl. media queries). Directionally agnostic. (block = vertically-based & inline = horizontally-based) Best used for smaller modules over broader layout
  • 4. “Old” and “New” syntax Oddly, the syntax has changed since initial conception - which has resulted in common references to “old” and “new” versions. Weaving together the two, (and in-betweens) provides decent browser support - especially for order-controlled grids ▪ Chris Coyier (2013) Requires additional code and prefixed code when authoring for best results. … consider a js library (autoprefixer) Examples NEW: display: flex; TWEEN: display; -ms-flexbox; OLD: display: box;
  • 5. Core Concepts Flexbox consists of: ▪Flex Containers ▪Flex Items Flex Container Declared on an element using the display property display: flex or display: inline-flex Flex Item Flex items are positioned inside of a flex container along a “flex line”. By default 1 flex line per flex container. contaner < items
  • 6. Core Concepts Flex Line (axis, rope) Flex items are laid out in a single “line” (default) or on several “lines” according to the flex-wrap property. No longer think about top-to-bottom or left-to-right. Abandon rows/columns thinking. direction orientation
  • 7. Core Concepts Flex Line In addition to Alignment, Orientation and Direction, flex lines can be reordered! This is huge. We can now structure our HTML for semantics, accessibility, and SEO .item { order: <integer>; } order By default, flex items are laid out in source order
  • 8. Core Concepts Nested Flex Lines Each flexbox layout (box) can contain another set that is on their own line. Nested flexboxes
  • 9. Core Concepts flex-wrap By default all flex items will try to fit together into one line. This can be changed and direction can be modified using the flex-wrap property. .container { flex-wrap: wrap; nowrap | wrap | wrap reverse }
  • 10. Core Concepts flex-grow Defines the ability for a flex item to grow if needed. (unitless values serve as proportion) An item set at 2 would be twice as big as an item set at 1. .item { flex-grow: <number>; /* default = 0 */ } flex-shrink Defines the ability for a flex item to shrink if needed. .item { flex-shrink: <number>; /* default = 0 */ }
  • 11. Core Concepts flex-basis Defines the default size of an element - before remaining space is distributed. Length or keyword values. .item { flex-basis: <number>; } If set to 0, the extra space around it is not factored in. If set to auto (keyword), the extra space is distributed by its flex-grow value
  • 12. Core Concepts flex (shortcut) Combines flex-grow, flex-shrink (opt) and flex-basis (opt). Default = 0 1 auto RECOMMENDED over individual properties. .item { flex: 1 0 0; }
  • 13. 1 Let’s look at some Code To the text-editor!
  • 14. Some other examples (that I didn’t have time to build) ▪ https://dl.dropboxusercontent.com/u/444684/flexbox/flexbox1.html ▪ https://dl.dropboxusercontent.com/u/444684/flexbox/flexbox2.html ▪ https://dl.dropboxusercontent.com/u/444684/flexbox/flexbox3.html
  • 15. Browser Adoption Can I Use? - caniuse.com
  • 16. Flexbox is the current new and now way of thinking about CSS layout - but not the end. Historic and current layout practices ▪ Table based layouts ▪ Float based layouts (CSS1) ▪ Positioning (CSS2) ▪ Flexbox “This is real layout. It’s not a hack” - Jeremy Keith ▫ Flexbox (old) ▫ Flexbox (mid/transitional) ▫ Flexbox (standard/final) The future is coming ‘soon’ and will likely build upon the flexbox model and techniques. ▪ Grid Layout (ie10 has adopted an early specification) ▪ Regions and Exclusions (Adobe initiative)
  • 17. ● https://developer.mozilla.org/en- US/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes ● http://www.sitepoint.com/are-we-ready-to-use-flexbox/ ● https://css-tricks.com/using-flexbox/ ● http://caniuse.com/#feat=flexbox ● https://css-tricks.com/snippets/css/a-guide-to-flexbox/ ● https://www.smashingmagazine.com/2013/05/centering-elements-with-flexbox/ ● https://www.smashingmagazine.com/2015/08/flexible-future-for-web-design-with-flexbox/ References