CSS Columns Tutorial for Beginners | Multicolumns without Grid or Flexbox

  Рет қаралды 16,429

Dave Gray

Dave Gray

Күн бұрын

Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGrayWebDevRoadmap
Learn how to create CSS columns in this tutorial for beginners. Multicolumns are possible in CSS without using CSS grid or flexbox. In this tutorial, we'll apply columns to multiple HTML paragraphs.
🚩 Subscribe ➜ bit.ly/3nGHmNn
🚀 This lesson is part of a CSS for Beginners tutorial series playlist:
• CSS Tutorials for Begi...
🔗 All Resources for this CSS Tutorial Series: github.com/gitdagray/css_course
📬 Course Updates ➜ courses.davegray.codes/
CSS Columns Tutorial for Beginners | Multicolumns without Grid or Flexbox
(00:00) Intro
(00:05) Welcome
(00:26) Setup
(01:01) Creating starting elements
(02:10) Adding columns to a container element
(03:37) Setting a column width
(05:00) columns shorthand
(05:27) column-rule
(06:39) column-gap
(07:05) Top margins and margin collapsing
(09:40) Adding a header to the columns
(11:07) break-inside
(11:43) break-before
(12:54) column-span
(18:16) Revisiting specificity
(20:12) Controlling line breaks with white-space
⚙ Web Dev Tools:
🔗 Chrome Browser: www.google.com/chrome/
🔗 Visual Studio Code (VS Code): code.visualstudio.com/
🔗 Live Server VS Code Extension: marketplace.visualstudio.com/...
🔗 vscode-icons VS Code Extension: marketplace.visualstudio.com/...
🔗 Github Themes VS Code Extension: marketplace.visualstudio.com/...
🔗 W3C CSS Validator: jigsaw.w3.org/css-validator/
🔗 Specificity Calculator: specificity.keegan.st/
🔗 HTML Special Characters and Entities: unicode-table.com
📚 References:
🔗 MDN CSS: developer.mozilla.org/en-US/d...
🔗 MDN CSS Basics: developer.mozilla.org/en-US/d...
🔗 MDN CSS Selectors: developer.mozilla.org/en-US/d...
🔗 MDN - How to Apply Colors to HTML Elements with CSS: developer.mozilla.org/en-US/d...
🔗 MDN - CSS Values and Units: developer.mozilla.org/en-US/d...
🔗 MDN - The Box Model: developer.mozilla.org/en-US/d...
🔗 MDN - Styling Lists: developer.mozilla.org/en-US/d...
🔗 MDN - Display Property: developer.mozilla.org/en-US/d...
🔗 MDN - Floats: developer.mozilla.org/en-US/d...
🔗 MDN - Columns: developer.mozilla.org/en-US/d...
🔗 MDN - Margin Collapsing: developer.mozilla.org/en-US/d...
🔗 MDN - White-Space: developer.mozilla.org/en-US/d...
📚 Typography Resources:
🔗 MDN: Fundamental Text and Font Styling - developer.mozilla.org/en-US/d...
🔗 CSSFontStack.com: Websafe Fonts - www.cssfontstack.com/
🔗 MDN: Styling Links - developer.mozilla.org/en-US/d...
📚 Color Resources:
🔗 Coolors Contrast Checker: coolors.co/contrast-checker/1...
🔗 WebAIM Contrast Checker: webaim.org/resources/contrast...
🔗 Coolors Palette Generator: coolors.co/
🔗 HTML Color Codes: htmlcolorcodes.com/
✅ Follow Me:
Github: github.com/gitdagray
Twitter: / yesdavidgray
LinkedIn: / davidagray
Blog: yesdavidgray.com
Reddit: / daveoneleven
Was this tutorial about the CSS Columns for Beginners helpful? If so, please share. Let me know your thoughts in the comments.
#css #columns #multicolumns

Пікірлер: 54
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
It is possible to easily create a multi-column layout in CSS without using flexbox or grid. In this tutorial, we will create a multi-column layout and look at different options we can use along with the columns. If you're just getting started with CSS, I recommend going to the beginning of this CSS for Beginners playlist: kzbin.info/aero/PL0Zuz27SZ-6Mx9fd9elt80G1bPcySmWit
@doinkstr
@doinkstr Жыл бұрын
Some tips, you can hover over a selector in VSCode and it'll tell you the Selector Specificity :). You can also press ALT+SHIFT+F to auto-format JS/HTML/CSS too!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Good tips!
@NorthTonawanda1
@NorthTonawanda1 Жыл бұрын
Awesome, Bing Chat suggested you when I asked specifically for a Tut on CSS Columns. I didn't like the way my restaurant menu looked in Grid where my food item cards sitting next to each other would expand to the height of the adjacent card when one has a much longer dish description. I knew CSS columns could probably do what I'm looking for. I like the way you teach - subscribed! (I use the text expander, Espanso, to add my EM DASH with the shortcut "--" prefixed with a semi colon.
@TravinskiyVladislav
@TravinskiyVladislav Жыл бұрын
Thank you, Dave
@anjaneyulub2529
@anjaneyulub2529 10 ай бұрын
Thanks Dave ❤
@TeomunMete
@TeomunMete 5 ай бұрын
Thank you. I haven't seen that anywhere
@arsyaswanth5
@arsyaswanth5 2 жыл бұрын
nice video Dave!!! would love more videos on css too apart from react stack. Thanks!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! I'm building my CSS for Beginners playlist here: kzbin.info/aero/PL0Zuz27SZ-6Mx9fd9elt80G1bPcySmWit - More to come! 🚀
@konstantinzakharov5643
@konstantinzakharov5643 8 ай бұрын
I finally made it to Columns and It is becoming real tough :)
@blastofffpv
@blastofffpv 6 ай бұрын
That's a nice dutorial, man.
@stormbytes
@stormbytes Жыл бұрын
Fantastic course so far!❤
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@GabrielSouza-yy2rq
@GabrielSouza-yy2rq Жыл бұрын
Great video as always Dave, thanks a lot. Btw, The Big Lebowski is a must watch 😄
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you, Gabriel - and I agree! 💯
@user-ml8rz2js9m
@user-ml8rz2js9m 2 жыл бұрын
Dave, thank you!!! I got a frontend developer job thanks to your amazing video!! I didn't know anything about programming, but your video and explanation are easy to understand. I really appreciate your hard work. You are my lifesaver👍👍
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
That is great news! 💯 Glad I could help! 🙏🚀
@KaimanGod
@KaimanGod 2 жыл бұрын
Where do you work
@jonkeck7489
@jonkeck7489 2 жыл бұрын
From one Kansan to another, very nice work!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Jon! 🙏 I hear we're in for *another* windy 💨 one today
@detailsstudio21
@detailsstudio21 Жыл бұрын
Thank you for this very quality content.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
@Testurteil20
@Testurteil20 Жыл бұрын
I could not reproduce the problem with "h2" element at 10:46, not with firefox, firefox dev or google chrome. Seems like its not a problem anymore? Oh boy at 19:00 you opened my eyes! I mean i know about specification but i would never expect it here that way. Realy good content 👍
@yadyad3832
@yadyad3832 Жыл бұрын
Really ,your way of teaching is amazing ,and has more informations.keep going thank you so much
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you for the kind words! 🙏
@ahmad-murery
@ahmad-murery 2 жыл бұрын
The only thing I find it impossible to implement without "css column" is spreading part of one paragraph in the next column, Thanks Dave, that was a great video 👍🚀
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Ahmad! 🙏🙏
@sonamohialdin3376
@sonamohialdin3376 Жыл бұрын
Very useful tutorial thank you
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome, Sona!
@manishankart6862
@manishankart6862 Жыл бұрын
Really a useful content👍
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@MrJettann
@MrJettann 2 жыл бұрын
That was such an amazing tutorial! I've got a lot new information about columns, thank you, Dave! But is there any way to make each paragraph on it's own column, without spreading?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏 Yes, you can achieve what you are asking with CSS Grid. Lesson 15 on CSS Grid shows how to quickly do this with grid-auto-flow: kzbin.info/www/bejne/e5K6m2V3jK5oe9U
@insteresting
@insteresting 8 ай бұрын
12:15 Setting the h2 styles as break-after: avoid; break-inside: avoid; seems to solve that problem.
@maelsito_was_taken
@maelsito_was_taken Жыл бұрын
Could you answer to me mr dave gray? I've watched your entire html tutorial and im almost at the end of the css one. You helped me a lot building web pages. Thank you
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
What are you asking? For questions, please join my Discord: discord.gg/neKghyefqh
@kaberanshutisamuel1856
@kaberanshutisamuel1856 18 күн бұрын
I didn't know specificity matters that much until this video 😂😂
@AnubhavSingh-nb3bt
@AnubhavSingh-nb3bt 3 ай бұрын
Sir can you please give name of web site for unicode character table that you are using in this vedio 😅
@xxkaisooxx874
@xxkaisooxx874 4 ай бұрын
Can someone tell me why the class columns was used with the class quote? in short this part: .columns .quote { font-size: 3 rem } the 3 rem was only applied to the quote, is there a reason to put the columns class first?
@Valdaur
@Valdaur 2 ай бұрын
How come you had to be more specific for the quote class when previously you were targeting the h2 inside of the columns class? And just to be clear, I understand the notion of specificity in general, but I don't understand how in this case the styling wasn't being applied when the quote class is being applied to a paragraph element, not to a h2. Hopefully you understand what I mean here.
@meetmehta2730
@meetmehta2730 2 жыл бұрын
Sir I have a doubt if you can answer that, the nowrap here in the case could also be achieved by " display: inline-block; ", so is it recommended to use that in this case and if no, then why? By the way very knowledgeable videos sir.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Often times there are more than one way to achieve the same goal. I prefer the white-space: nowrap; because that is what it is made to help with. The other approach you mention does also work. 🚀
@Saikiran-ty8mo
@Saikiran-ty8mo Жыл бұрын
Thank you sir for the wonderful course . I have a doubt that , i thought instead of using "white-space : nowrap" , I have tried " break-inside : avoid" . As per the tutorial , break-inside helps us to not split the element right ? But it is not working . Could you please clarify my query. Once again really thank you for the course sir .
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
MDN provides a great reference for any specific properties including both white-space (developer.mozilla.org/en-US/docs/Web/CSS/white-space) and break-inside (developer.mozilla.org/en-US/docs/Web/CSS/break-inside). These properties have very different targets: how white-space is handled inside an element vs how page, column, or region breaks are handled inside of a box.
@patriciaksbr
@patriciaksbr Жыл бұрын
Hi everyone! Do you think it's ok if I use div instead of section as a container for the paragraphs that will be displayed in columns? This way the html file can be validated on w3c without the warning "Section lacks heading".
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
When you get to the project at the end of this series, you will see how I handle this. You can create a heading which helps identify your section to screen readers, and at the same time, you can move it off of the screen if you don't want to see it.
@patriciaksbr
@patriciaksbr Жыл бұрын
@@DaveGrayTeachesCode Awesome! Thanks for answering and for this amazing tutorial. That's very generous of you.
@abdomahmoud8769
@abdomahmoud8769 2 жыл бұрын
1:47 why don't you just use auto format on save from the settings and disable prettier
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Never slowed down to change those settings, but good suggestion! I have now removed Prettier.
@dimitarantonov9778
@dimitarantonov9778 5 ай бұрын
Just when you were thinking you can not like Dave Gray more.... and hop.... He likes not just tacos but The Dude too..... :)
@ifeanyiuche4064
@ifeanyiuche4064 Жыл бұрын
This is 😅 complicated 😂 my brain is about to explode
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You will get it. No rush. Take your time and refer to the provide documentation links if needed.
@vasellious5134
@vasellious5134 Жыл бұрын
columns overlap eachother for me
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Compare your code to the code available at the course resources link in the description. Also consider your screen width and then column width.
CSS Grid Intro and Basic Layout Tutorial for Beginners
25:38
Dave Gray
Рет қаралды 27 М.
Which one is the best? #katebrush #shorts
00:12
Kate Brush
Рет қаралды 21 МЛН
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 12 МЛН
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 3,7 МЛН
The most underappreciated CSS property
9:02
Kevin Powell
Рет қаралды 68 М.
Why I use grid over flexbox for this common layout
7:32
Kevin Powell
Рет қаралды 228 М.
The secret to mastering CSS layouts
17:11
Kevin Powell
Рет қаралды 266 М.
Learn CSS Subgrid in 14 minutes
14:19
Slaying The Dragon
Рет қаралды 55 М.
CSS Units & Sizes Tutorial for Beginners
21:25
Dave Gray
Рет қаралды 32 М.
CSS Colors Tutorial for Beginners
17:15
Dave Gray
Рет қаралды 25 М.
CSS Custom Variables & Dark Mode | CSS Tutorial for Beginners
28:15
Learn CSS Grid the easy way
37:04
Kevin Powell
Рет қаралды 872 М.
Which one is the best? #katebrush #shorts
00:12
Kate Brush
Рет қаралды 21 МЛН