14. Setting the columns widths - Responsive CSS Tutorial
Key Takeaways
Demonstrates setting column widths using percentages and CSS for a responsive web design project
Full Transcript
all right so let's fix the wits on our columns here to get them to be the sizes that we want them to be so if you remember I said that I'm gonna use a modifier class once again now you don't have to necessarily use a modifier class but we're going to get really used to using modifier classes so I want you to sort of get in that mindset now the original way I was gonna look at it was we can use our doc call which would be this would just be one width and we could have it call two and a call three but I'm gonna set up the same idea but I'm have a call one call to call three and there could technically I guess be a call for that would stretch the whole width now I am gonna keep this slow I didn't keep this slide here though before I thought of that because I did want to look at the idea of why I'm calling it call two and why I'm calling it column three and the way I'm looking at it is this is a four column layout I have if I divided this into equal spaces I'd have four if I took the smallest column I could have four of them across the entire width of this layout so it's a four column layout this one is double the width of this one and this is three times the width of my sort of default or my smallest column here so I have my column two which is going to be double the size and this one which is gonna be triple the size so what I want you to do is if you didn't do it on the last video when I said you have a chance because you weren't really sure what to do try giving it a go now that I've explained a little bit more and then I'm gonna look at sort of the trickiest thing was how do you decide exactly how big they should be all right so I hope you got it so what I'm gonna do now is I'm gonna come over here and I'm going to come in actually to my index here first and we have to add those class columns to here so this is a column and it's gonna have the width of a column one then I'm going to have this one have the column two and this one is also going to be a column one down here I'm gonna have a column three and this last one will be a column one so if I come over to my Styles now and I come and create some styles for those so we're gonna have a call one a Col two and a call three and what unit do you think would make the most sense for setting the sizes on these like if you were gonna do what's the easiest way you could decide the width that one of these would be you know pixels would be a nightmare just because you don't how many pixels big should it be the screens always changing and then well then it's not gonna work at all the screen sizes MS and REMS same deal it just it's not going to function this is where percentage really come into play so my call one I can give this a whiff the question is how big do I make it well I just said when we were looking at that last slide we're gonna divide this up into four so if I made this 25% then I know that this one should be a width of 50% and I know that this one here should be a width of 75% so let's come and look and see how that worked on my layout and look at that everything is lining up this is a call one and this is a call one so now they're actually the same size as one another they're working out the way we'd wanted them to work out before they're matching each other that's that's perfect right before this was bigger but it was a lot bigger now everything is lining up with one another the only problem we have now is there's no space between our columns and there's a lot of different ways we can approach this lack of space a lot of popular ways are using margins and padding to create space but then this first column needs a different style because you can't have any margin on the left or this one needs a different style because it can't have anything on the right side and then you know the same thing here you start getting into a little bit of issues or problems with it and luckily flexbox actually has a really good way to solve this I'm gonna see that solution in the next video
Original Description
🎓 View our courses: https://scrimba.com/links/all-courses
This tutorial is a part of "The Responsive Web Design Bootcamp" on Scrimba. Explore the full course here: https://rebrand.ly/responsivebootcamp_yt
When setting up columns, in general percentage is the best type of unit to use, as it makes it very easy to device a layout up.
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Scrimba · Scrimba · 51 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
▶
52
53
54
55
56
57
58
59
60
CSS Grid Course: Learn the Basics in 3 Minutes
Scrimba
CSS Grid Course: Positioning Items
Scrimba
CSS Grid Course: Why Learn It And How It Compares To Bootstrap
Scrimba
CSS Grid Course: auto-fit & minmax
Scrimba
CSS Grid Course: Implicit Rows
Scrimba
CSS Grid Course: Fraction Units And Repeat
Scrimba
CSS Grid Course: Justify Items and Align Items
Scrimba
CSS Grid Course: An Awesome Image Grid
Scrimba
CSS Grid Course: Named Lines
Scrimba
CSS Grid Course: auto-fit vs auto-fill
Scrimba
CSS Grid Course: Justify Content and Align Content
Scrimba
CSS Grid Course: Template areas
Scrimba
27. Setting up the structure - Responsive CSS Tutorial
Scrimba
25. Making the navigation responsive - Responsive CSS Tutorial
Scrimba
36. Playing with the title's position and negative margins - Responsive CSS Tutorial
Scrimba
31. Starting the CSS for our page - Responsive CSS Tutorial
Scrimba
26. Taking a look at the rest of the project - Responsive CSS Tutorial
Scrimba
15. Spacing out the columns - Responsive CSS Tutorial
Scrimba
33. Starting to think mobile first - Responsive CSS Tutorial
Scrimba
22. Making our navigation look good - Responsive CSS Tutorial
Scrimba
37. Changing image size with object-fit - Responsive CSS Tutorial
Scrimba
44. Module Wrap up - Responsive CSS Tutorial
Scrimba
16. Controlling the vertical position of flex items - Responsive CSS Tutorial
Scrimba
39. Setting up the widgets and talking breakpoints - Responsive CSS Tutorial
Scrimba
42. Setting up the About Me page - Responsive CSS Tutorial
Scrimba
35. Changing the visual order with flexbox - Responsive CSS Tutorial
Scrimba
23. Adding the underline - Responsive CSS Tutorial
Scrimba
21. Using flexbox to start styling our navigation - Responsive CSS Tutorial
Scrimba
20. Creating a navigation - Responsive CSS Tutorial
Scrimba
40. Using a new pseudo class to wrap up the homepage - Responsive CSS Tutorial
Scrimba
43. Fixing up some loose ends - Responsive CSS Tutorial
Scrimba
32. Starting the layout. Looking at the big picture - Responsive CSS Tutorial
Scrimba
24. A more complicated navigation - Responsive CSS Tutorial
Scrimba
28. Feature article structure - Responsive CSS Tutorial
Scrimba
34. Styling the featured article - Responsive CSS Tutorial
Scrimba
18. Making layout responsive with flex direction - Responsive CSS Tutorial
Scrimba
19. flex direction explained - Responsive CSS Tutorial
Scrimba
41. Creating the recent posts page - Responsive CSS Tutorial
Scrimba
17. Media Query basics - Responsive CSS Tutorial
Scrimba
30. Home Page. HTML for the aside - Responsive CSS Tutorial
Scrimba
38. Styling recent articles for large screens - Responsive CSS Tutorial
Scrimba
29. The home page. HTML for the recent articles - Responsive CSS Tutorial
Scrimba
10. ems and rems an example - Responsive CSS Tutorial
Scrimba
1. Starting to think responsively - Responsive CSS Tutorial
Scrimba
4. Controlling the width of images - Responsive CSS Tutorial
Scrimba
5. min width and max width - Responsive CSS Tutorial
Scrimba
3 CSS Units. Percentage - Responsive CSS Tutorial
Scrimba
11. Flexbox refresher and setting up some HTML - Responsive CSS Tutorial
Scrimba
12. Basic Styles and setting up the columns - Responsive CSS Tutorial
Scrimba
8. The Solution Rems - Responsive CSS Tutorial
Scrimba
14. Setting the columns widths - Responsive CSS Tutorial
Scrimba
2 CSS Units - Responsive CSS Tutorial
Scrimba
7. The problem with ems - Responsive CSS Tutorial
Scrimba
6. CSS Units. The em unit - Responsive CSS Tutorial
Scrimba
13. Adding the background color - Responsive CSS Tutorial
Scrimba
9. Picking which unit to use - Responsive CSS Tutorial
Scrimba
Tutorial to Learn Alpine JS - Full Course for Beginners
Scrimba
Guide To Algorithms in Javascript [Binary Search] - Full Course / Tutorial
Scrimba
Learn UI Design [7 Fundamentals Tutorial] - Full Course for Beginners
Scrimba
Javascript Tutorial for Beginners [From 0 to ES6+] - Full Course
Scrimba
More on: HTML & CSS
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
How to Create a Second Version of Yourself Inside Obsidian Using AI (Step-by-Step Guide)
Medium · ChatGPT
How to prepare for Spain civil service TIC exam using AI in 2026
Dev.to · David García
Going Viral! How I Created AI Kissing Videos Step by Step Easily Using AIAI.com
Medium · AI
How to prepare TIC teacher exams in Spain with AI (oposiciones 2026)
Dev.to AI
🎓
Tutor Explanation
DeepCamp AI