chore: remove manual image spacing and add alt text
@@ -36,7 +36,7 @@ This tutorial will cover the following items in order:
|
||||
|
||||
## Box Model
|
||||
|
||||

|
||||

|
||||
|
||||
The box model is a representation of a documents element through a set of boxes with the following properties:
|
||||
|
||||
@@ -119,13 +119,13 @@ The CSS property `display: flex` is also known as flexbox. Flexbox is used for c
|
||||
flex-direction: column;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
flex-direction: row;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Adding `display: flex` to a container will cause any immediate descendants to become flex items. Using a few additional CSS properties we can align, justify, and space these same flex items inside the container.
|
||||
|
||||
@@ -145,19 +145,19 @@ These placement methods are used to distribute both flex and gridbox items:
|
||||
align-items: center;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
align-items: flex-end;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
align-items: flex-start;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
> 🤓 Keep everything inline with align-items
|
||||
|
||||
@@ -169,37 +169,37 @@ align-items: flex-start;
|
||||
justify-content: center;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
justify-content: flex-end;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
justify-content: flex-start;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
justify-content: space-around;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
justify-content: space-between;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
justify-content: space-evenly;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
> 🤓 Space your content out with justify-content
|
||||
|
||||
@@ -228,7 +228,7 @@ grid-template-areas:
|
||||
grid-template-columns: 1fr 1fr;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
@@ -238,7 +238,7 @@ grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 1fr 2fr 1fr;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Adding `display: grid` to a container will cause any immediate descendants to become grid items. Similar to flexbox, we can use placement methods to help align, justify, and space grid items inside the container.
|
||||
|
||||
@@ -250,19 +250,19 @@ Adding `display: grid` to a container will cause any immediate descendants to be
|
||||
place-items: center center;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
place-items: end end;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
place-items: start start;
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
> 🤓 Place-items is super effective if using gridbox
|
||||
|
||||
@@ -287,7 +287,7 @@ The CSS property `position` determines an elements flow inside a document.
|
||||
|
||||
The CSS properties `top`, `bottom`, `left`, `right` are used on positioned elements to control an offset while `z-index` controls the elements order (bringing it to the front or back).
|
||||
|
||||

|
||||

|
||||
|
||||
```css
|
||||
.root {
|
||||
@@ -343,7 +343,7 @@ There are five types of element positions:
|
||||
|
||||
For example, YouTube uses a flexbox to space out their headers children elements:
|
||||
|
||||

|
||||

|
||||
|
||||
> 🤓 Mastering the flexbox will take you very far in CSS as it is used everywhere
|
||||
|
||||
@@ -355,7 +355,7 @@ For example, YouTube uses a flexbox to space out their headers children elements
|
||||
|
||||
For example, Spotify uses a gridbox to achieve their playlist player layout:
|
||||
|
||||

|
||||

|
||||
|
||||
#### Positioning:
|
||||
|
||||
@@ -364,7 +364,7 @@ For example, Spotify uses a gridbox to achieve their playlist player layout:
|
||||
|
||||
For example, the cookies modal on stackoverflow uses a fixed position to stay on your screen while hovering above other document elements:
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
@@ -372,7 +372,7 @@ For example, the cookies modal on stackoverflow uses a fixed position to stay on
|
||||
|
||||
Responsive Design is an approach to web design where the goal is to create a layout that will render beautifully on any device or screen size.
|
||||
|
||||

|
||||

|
||||
|
||||
To achieve this, designers can use media queries (AKA breakpoints) to add, override, and unset styles on any screen size.
|
||||
|
||||
@@ -532,4 +532,4 @@ CSS variables allow us to define arbitrary values for reuse across a stylesheet.
|
||||
|
||||
It is common to use CSS variables for repeated values such as colors, font-size, padding, etc.
|
||||
|
||||
> ⚡ [Live Code Example: CSS Variables](https://codesandbox.io/s/css-variables-tx14z?file=/styles.css)
|
||||
> ⚡ [Live Code Example: CSS Variables](https://codesandbox.io/s/css-variables-tx14z?file=/styles.css)
|
||||
|
||||
|
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 6.7 KiB |