The explanations below are a brief overview of each concept. Read the recommended articles to get in-depth explanations of each concept.
The first step to gaining a stronger understanding of CSS is to learn how Cascading, Inheritance & Specificity control how rules are applied:
Cascading
Cascade is the fundamental concept of how CSS was created. As the name suggests, Stylesheets cascade. This means that the order of CSS rules matter and when two rules apply that have equal specificity the one that comes last in the CSS is the one that will be used.
Inheritance
Some CSS property values set on parent elements are inherited by their child elements, some aren't. This can often be confusing but the principle behind it is actually designed to allow us to write fewer CSS rules.
1/2
Properties such as 'color' and 'font-family' are inherited which is why we often use the BODY element to assign them to.
It is also worth knowing that every CSS property accepts four values to control inheritance essentially being able to turn inheritance "on and off".
2/2
Specificity
As multiple rules apply to an element conflicting rules are sorted and applied by specificity. Each selector has a different specificity ranking:
1. Id's 2. Class and Pseudo Class's 3. Element selectors
1/2
As rules conflict, CSS determines the rule with the highest specificity and applies it to the element.
The !important property overrides any specified rules & makes sure the rule denoted is applied. Without understanding the 3 concepts above, it is easy to get into the habit of using !important on every property that doesn't get applied as expected.
1/2
However, it's important to understand that most developers consider the use of !important an anti-pattern. Read the articles below to grasp a better understanding of when and how to use !important.
CSS Media Queries are used to change the style of your site depending on what screen resolution or device is being used.
Media Queries can be combined to create specific scenarios for when you want to apply certain rules to that situation.
1/2
This allowed for the concept of responsive & adaptive design to work coherently in the browser. Learn how to define, use & understand Media Queries, check out the articles below.
Over the years it's become apparent that CSS isn't easy to grasp.
Thankfully as the language has evolved, concepts like Flexbox and Grid have been introduced. They both offer a solution that makes positioning & page layout much easier, faster & responsive.
1/3
CSS Grid Layout is a two-dimensional layout system. It lets you lay content out in rows and columns, and has many features that make building complex layouts straightforward.
With Meta Tags you can edit and experiment with your content then preview how your webpage will look on Google, Facebook, Twitter and more when shared.
As developers, we spend a lot of time sitting at our desks.
Good sitting posture improves blood flow, keeps your nerves & blood vessels healthy, & supports your muscles, ligaments & tendons.
🧵 Try out these tips to get you sitting correctly at your desk:
🖥️ Monitors
The top of your screens should be at or just below eye level.
Tilting the monitor back 10° to 20°, our eyes should look slightly downward when viewing the middle of the screen to promote a healthy sitting position.
🤷♂️ Shoulders
Your shoulders should be relaxed and positioned low.
Try to be aware of them rising towards your ears or rounding forward throughout the working day.
Doing so will also ensure you maintain contact between your back and the seat.
Search Google for any of these #free books, they will show as one of the top results.
Download or read them online, they will provide you with a deep understanding of JavaScript.
- Eloquent JavaScript
- You Dont Know Js
- Learning JavaScript Design Patterns
📘 Books 2/2
- Speaking JavaScript
- JavaScript: The Good Parts
- JavaScript For Cats
- DOM Enlightenment
- Understanding ECMAScript 6
- Human JavaScript
- Flavio Copes JS Handbook
Keep it simple. Color should be used sparingly to highlight important information and CTAs.
For the rest of your site, use a color generator. They follow WCA Guidelines and provide thousands of beautiful color schemes to choose from.
Typography
Keep fonts legible and appropriate for the style of communication. Sometimes using a combo of two sans-serif system fonts is enough, improves loading times and removes the hassle of importing fonts.
For everything else, Google Fonts has you covered!