This topic is for members of the January 2018 fCC cohort to share information and learn more about responsive web design principles and CSS Flexbox. Click on the cohort link if you’d like to join.
In general, design the page’s CSS to your target audience. If you expect most of your traffic to be from mobile users, take a ‘mobile-first’ approach. Then add conditional rules for larger screen sizes. If your visitors are desktop users, then design for larger screens with conditional rules for smaller sizes.
For most my of my projects, and I’m guessing for most general purpose websites and web applications, most visits will be coming from mobile users so a ‘mobile-first’ approach is likely best. However, that may not always be the case, depending on the purpose of the site.
I tend to use px and rem when sizing things in CSS, whether that’s an image or text. I usually work with relatively simple projects though, so this hasn’t been a problem. The CSS Font Sizing: Pixels vs Em vs Rem vs Percent vs Viewport Units article outlines the different sizing units and has some good links for further research at the end.
Starting to fall behind in this due to work being hectic at the moment, I have already done all the challenges however for each post I was wanting to go over each to try and firm up everything. Hoping to nuckle down tonight after the gym and get some coding done. I have been using the Solo app in my morning commute to reinforce some html and CSS coding which isnt the greatest but I am at least still doing some sort of coding work each day. sigh
I had some problems with entering answers for beta challenges but not the same as yours. Some of the challenges would not accept any answers that I entered. After several attempts, I copy pasted the sample code from the lesson and changed it to meet the requirements. I was able to pass the tests. It happened for very few challenges though.
@johnhannahdev I usually start with the mobile view for viewports between 320px and 768px wide. Then I’ll make a tablet view for viewports between 768px and 1024px (min-width: 768px). Then the view for larger viewports (min-width: 1024px). I test my design on as many viewport sizes as possible and add additional media queries as needed.
I’m not an expert. This is the way I’ve learned up to this point.
I finished the CSS Flexbox section today. When I initially learned CSS Flexbox, I spent hours playing around with code until I understood as much of it as I could. I also spent about 10 days (one section each day so I could retain the information better) on Flexbox Zombies and Flexbox Froggy. The freeCodeCamp CSS Flexbox section is comprehensive and well-written, but I think one will need to supplement their learning with these and other materials before really being able to use CSS Flexbox.
For others that have already learned CSS Flexbox, what other resources helped you understand CSS Flexbox better?
I think there are some css links in the forum, at the top.
I came across this. CSS Reference
It looks good.
The guy is also selling a book but the site has loads of info and example code.
aligns items to the center of the main axis, with extra space placed between the items.
I think this is not a correct explanation since the items are aligned to the edges rather than the center in a situation where there is an even number of items. It happens to be in a situation where there is an odd number of items that the middle item will be aligned to the center.
Give #box-1 the values so its flex-grow is 2, its flex-shrink is 2, and its flex-basis is 150px. Give #box-2 the values so its flex-grow is 1, its flex-shrink is 1, and its flex-basis is 150px.
These values will cause #box-1 to be twice the size of #box-2 when the container is greater than 300px and half the size of #box-2 when the container is less than 300px.
This is incorrect since #box-1 will only grow and shrink at twice the rate. I found this forum post discussing this mistake.
Also, I cannot figure out the goal of setting display: flex on the h3 & h4 elements in the tweet embed examples.