CSS Flex Basis (flex-basis) Explained - Beginner Flexbox Tutorial

  Рет қаралды 3,808

Front End Beginners

Front End Beginners

Күн бұрын

In this tutorial, we look at how the "flex-basis" property works in CSS Flexbox.
"flex-basis" determines the initial starting size of a child flex item before either flex-grow or flex-shrink have been applied to it.
All flex items are given a default flex-basis value of "auto", which means their initial starting size is based either upon their "min-content" width, or an absolute width if already specified elsewhere in the CSS.
"flex-basis" accepts any size value, such as pixels, relative units, or percentages.
"flex-basis" can also be given a value of 0, which means the browser ignores a flex item's initial size when calculating how much space it should occupy inside its parent container, if re-sizing with either flex-grow or flex-shrink.
All of the examples in this video use the default flex-direction of "row", however the principles remain the same when using a flex-direction of "column". Just be aware that the height of the flex items will be affected, rather than the width.
I hope you found this video helpful. If you have any questions, please leave them in the comments below and I'll do my best to answer as soon as possible.
TIMESTAMPS:
00:00 Introduction
00:24 What is flex-basis?
00:51 Understanding flex-grow
02:09 Understanding flex-shrink
03:32 The default flex-basis value of "auto"
05:00 Setting a flex-basis value other than "auto"
06:42 Using individual flex-basis values on individual flex items
08:54 Using a flex-basis value of "0"
10:53 Working with "flex-direction: column"
11:21 Summary
WATCH NEXT:
• CSS Flex Direction (flex-direction) Explained - • CSS Flex Direction (fl...
• How to Perfectly Center an Element using CSS Flexbox - • How to Perfectly Cente...
• How to Create a Sticky Footer using CSS Flexbox - • How to Create a Sticky...

Пікірлер: 36
@sambangialekhya4488
@sambangialekhya4488 11 күн бұрын
Sir your english is very simple and easily understandable by everyone, including those with average English speaking skills. Thank you sir
@raven.4815
@raven.4815 Жыл бұрын
Best video about flex-basis by far!
@X-chess7
@X-chess7 6 ай бұрын
Your videos are the best beautifully explained.Thanks a lot.
@Mashael_96
@Mashael_96 Жыл бұрын
Your are the best one who is explain flex-basis .. I find issue for what is actually flex-basis does but the explain really help me.. Thank you so much
@YousifAtique
@YousifAtique 4 ай бұрын
proved really helpful to me understanding flex-basis - many thanks
@ling6701
@ling6701 2 жыл бұрын
best explanation I've found on flex-basis. Thanks.
@reihanseptyawan9347
@reihanseptyawan9347 2 жыл бұрын
i was stuck in flex zombies game in level flex-basis, and this very helpful :)
@poewi9791
@poewi9791 2 жыл бұрын
Super helpful! I was struggling to understand what flex-basis actually does and your explanation was very clear. Thanks!
@frontendbeginners119
@frontendbeginners119 2 жыл бұрын
Thanks very much... I'm glad it helped!
@arianoveiri206
@arianoveiri206 2 жыл бұрын
I don't know how to thank you ! It was difficult to understand what flex-basis actually is... Your explanation was super awesome !
@frontendbeginners119
@frontendbeginners119 2 жыл бұрын
Thanks very much! I'm really glad you found it helpful :)
@arthurradium5823
@arthurradium5823 2 жыл бұрын
Very nice Video.. now i get the difference between flex-basis and width !
@frontendbeginners119
@frontendbeginners119 2 жыл бұрын
That's great... I'm really pleased it helped! Thanks very much for watching
@tadascibiras2227
@tadascibiras2227 2 жыл бұрын
The best explanation of all flex tutorials. Keep making great content!
@JavascriptForEverything
@JavascriptForEverything 10 ай бұрын
Finally, I de-mystrify the flex-item width, thanks a lot.
@usagiakimbo2506
@usagiakimbo2506 2 жыл бұрын
Finally clear and easy to understand explanation of flex-basis! Thank you very much!
@frontendbeginners119
@frontendbeginners119 2 жыл бұрын
Thank you! You're welcome and I'm glad it helped.
@computersmith9095
@computersmith9095 2 жыл бұрын
Thanks bro! clear and concise Very helpful
@frontendbeginners119
@frontendbeginners119 2 жыл бұрын
You're welcome! Thanks very much
@freakazoidas
@freakazoidas 2 жыл бұрын
clear and simple, thanks for the video!
@brylleabella7153
@brylleabella7153 2 жыл бұрын
Thank you so much for this clear explanation! I was having a hard time following The Odin Project's discussion of flexbox so this is a lifesaver
@Copernicus_Song
@Copernicus_Song 2 жыл бұрын
Thank you very much!!! the clearest answer on the internet!! I finally understand this flex-basis =D I found a lot of explain on the internet, no one can explain this better than you!
@frontendbeginners119
@frontendbeginners119 2 жыл бұрын
Thanks very much! I'm really glad it helped.
@iganic7574
@iganic7574 3 ай бұрын
wonderful explanation ❤
@bodhicreative279
@bodhicreative279 Жыл бұрын
Thanks so much, you couldn't have explained this better! These flex-basis options are tricky concepts to grasp, but thanks to you I was able to implement this in combination with a flex-children wrap in-between breakpoints to achieve a much better layout for my tabs component - thanks a bunch!
@seangrogan8307
@seangrogan8307 Жыл бұрын
Thanks, this was a very useful video
@suenequeiroz9512
@suenequeiroz9512 Жыл бұрын
great explanation. Thank you for that
@manthanpatel642
@manthanpatel642 2 жыл бұрын
thank you Tom :) .... there is no better explanation possible !!! you are genius :) , I've learned so much by watching your videos. The one I won"t ever forget is the video in which you describe the difference between align-items and align-content . I was stuck with that topic and you explained it so so well ! I have one small request ...please make video on media queries. Thank you so much again :)
@frontendbeginners119
@frontendbeginners119 2 жыл бұрын
Wow, thanks so much! I'm really glad my videos have helped you. I'll add media queries to my list of topics and hope to get something uploaded soon. Thanks for watching! :)
@reallygoodstuff4441
@reallygoodstuff4441 2 жыл бұрын
Great video 🔥😍
@frontendbeginners119
@frontendbeginners119 2 жыл бұрын
Thank you!
@mocococo2877
@mocococo2877 10 ай бұрын
Amazing tutorial. Thank you. Please, tell me / us if we want to assign flex's elements some width (say flex direction row) is it the same if we give them through just CSS width or through flex-basis ? Thank you.
@im2godly750
@im2godly750 Жыл бұрын
Awesome and super imformative! Can you do JSX next please? :)
@tusharcreates
@tusharcreates Жыл бұрын
I don't know how to get this. I have some doubts like - 1. What's exactly the flex-basis property is doing what the width property can't do? 2. All the stuff I've gone through explaining flex-basis, they mentioned that it was used to set the initial width/height. What does this actually mean. Why not just set the width/height (depending on the flex-direction)?
@sambangialekhya4488
@sambangialekhya4488 Жыл бұрын
you have to watch the video more than 2 times then u will understand the concept.
@bhavyawadhwa1
@bhavyawadhwa1 Жыл бұрын
At 10:15 you said that "when using flex-basis:0; the browser will ignore their initial size when sharing out the total width of the container and each item will end up the exact same size.". This is somewhat incorrect. --> Here flex-basis is not the real reason why items turn out as equal size. You can achive the same result by applying width:0 or or that matter any equal width say 10px or 20px to all the items. Flex-grow is the actual reason why they grow out to be of equal size. flex-basis just sets their width to 0px;
CSS Flexbox "align-items" vs. "align-content" - Beginner Tutorial
12:48
Front End Beginners
Рет қаралды 8 М.
CSS Flex Grow (flex-grow) Explained - Beginner Flexbox Tutorial
12:18
Front End Beginners
Рет қаралды 642
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 64 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 9 МЛН
The thing people get wrong about flex-basis
9:00
Kevin Powell
Рет қаралды 59 М.
I finally found a great use-case for flex-basis!
4:18
Kevin Powell
Рет қаралды 55 М.
6 Advanced Flexbox Features You Probably Don’t Know
14:54
Web Dev Simplified
Рет қаралды 112 М.
Create a Simple Responsive Footer with CSS Flexbox - Beginner Tutorial
14:08
Front End Beginners
Рет қаралды 3,9 М.
How Do Flex-Basis, Flex-Grow, Flex-Shrink Work? | CSS Flexbox
14:11
The Code Creative
Рет қаралды 9 М.
CSS Flexbox "justify-content" vs. "align-items" - Beginner Flexbox Tutorial
7:00
[Code with Juntao] What does flex:1 mean anyway?
14:13
I Code It
Рет қаралды 1,9 М.
Learn Flexbox CSS in 8 minutes
8:16
Slaying The Dragon
Рет қаралды 1,5 МЛН
How to Use CSS Flexbox Inside CSS Grid - Beginner Tutorial
8:00
Front End Beginners
Рет қаралды 6 М.
Не уступила место беременной и начались роды 😮
0:49
Фильмы I Сериалы
Рет қаралды 1,1 МЛН
Who will make it?
0:19
The Stella Show
Рет қаралды 8 МЛН
他们在说什么,不能当面说。#海贼王#路飞
0:15
路飞与唐舞桐
Рет қаралды 10 МЛН
Some muslims mistakes #muslimfemale #hijab
0:11
Asel Mustafaeva
Рет қаралды 17 МЛН
CAA Conversion kit at ZAHAL 🎯
0:14
Zahal Youtube
Рет қаралды 42 МЛН