CSS
Like we learned with the box model, every element in your HTML doc is a box. Each box can contain more boxes and so on and so forth. When it comes to using flex 1st understanding what will be effected is important.
Here we see our box model the element content is what we are focusing on nowโฆwe know that paddings, borders, and margins affect the elements but what about when those elements contain children.
Our flex container here is our element content. So we are inside our box now. In this case our content or box has 3 smaller boxes contained inside.
Lets do some pseudocode using a school.
So we have this school with 2 rooms in it. The school it's self being a box will have it's own padding, border, and margin to it. and as will each and every other element listed. By default html reads top to bottom, meaning as it is written right now everything will line up in 1 column on the left.
But along with our HTML we were given the following blueprint:
Looking at this and the code above and knowing the default properties we have some changes to make.
Ok so if we were to look at our page we would have our school and 2 rooms next to each other each with 6 desks in a column.
So now if we have this page pulled up it should look like the blueprint.
What are they and why?
As a rule of thumb you should style your site to work on 3 basic sized devices
Before you start styling you need to 1st descide do you want to style for mobile or desktop 1st. What this means is the bulk of your css will apply for which screen size, mobile or desktop, after that you will create the media queries to go up (if you chose mobile first) or down (if you chose desktop first)
Many developers now are styling mobile first now as most of the end users are viewing websites on their phones not desktops.
Always remember that your CSS document is read top down. So all media queries must be at the bottom of your document and in the proper order as well.
Here order is important so that it only changes what we want it too when we want it too.
Again oder is important so that it changes when we want it too.
You style just as you normally would just make sure that the changes are inside the brackets for the media you are working on.
What is this and why?
Well A CSS Reset is how you would over ride the browser defaults. As you know by now an h1 tag has natural built in styling, it's font size is bigger and bolder than a p tag and there seems to be some margin's around it.
A CSS reset when applied to the begining of your stylesheet takes defaults like that and well resets them. There are many ways you can create a reset like just making it so there are no natural padding or margins, or using some others that are pre done so to speak.
Here is a link to a collection of them. CSS Reset Collection