This week we started getting into the weeds with CSS. We learned about inheritance, the cascade, and specificity, CSS reset vs. Normalize reset, and started styling our own html documents with CSS.
I learned that inheritance is when child elements take on styling that their parents passed down to them, just like how genes are passed on from parent to child. The Cascade is the mechanism that relates to how CSS rules that are in conflict with each other are sorted out by the browsers. And specificity is the process by which the browser determines which rule to apply to an element to solve conflicts. These concepts determine how your browser solves conflicts when you create new CSS rules that override the browser’s CSS. Hierarchy and specificity of your elements is ultimately how an element ends up being styled.
CSS reset is a stylesheet that removes all of the default styling from a page and normalize reset only minimizes the differences with the browser’s styling. Either work, but it depends on how much work you want to put into styling your document. The advantages of CSS reset is that it really forces you to really style everything rather than accept the default, can more purposely make decisions as to how to design site, and is easier to follow design standards. The downside is you have to style everything. Normalize has it’s pros in that it saves time for styling, especially for newbies. The disadvantage is that you are constantly fighting the browser’s styling and end up needing to create separate rules for overriding the browser’styling, and you may miss something.
The takeaway this week was that HTML and CSS are the bedrock of all website design, and to gloss over them is missing the very basics of website design. We need these programming languages in order to create websites, so I’m excited to be starting from scratch because I feel like I’m learning the fundamentals the old fashioned way, and as the saying goes “if it ain’t broke, don’t fix it”. I feel empowered to keep going!