HTML
- The head element contains information about the webpage.
-
The body element represents the visible content shown to the user.
-
The title element will be displayed on the browser's tab. It helps
users find the webpage with SEO (Search Engine Optimisation).
- !DOCTYPE is specifying what type of document the file is.
- You can add the lang attribute to the HTML element.
-
charset stands for Character set, which is usually UTF-8 (Unicode
Transformation Format-8bit)
-
You can add many attributes to an HTML element. Attributes can only
be added in the opening brackets.
CSS
- CSS are made up of three parts: Selector, Property & Value.
-
Some properties can have shorthand versions which allow you to
manipulate multiple values
e.g. margin =
margin-top, margin-right, margin-bottom, & margin-left.
- Classes are preceeded by a period (e.g. .card).
- IDs are preceeded by a hash (e.g #html-section).
-
Limit elements by selecting through parent elements.
e.g. #html-section li selects only the list items inside
html-section.
-
An element can be selected many times but can only use one value
that wins through Selector Specificity.
- Play CSS Diner to practice different ways to select elements.
CLI
-
cd: Changes directory (Must be in the parent folder first).
-
cd ..: takes you one step outside the current directory.
- mkdir: Creates a folder in the current directory.
-
ls: Allows you to see the items in the current directory.
- touch: create a new file in the current directory.
-
code .: Opens items from the current directory in VS Code.
Git
- git status: checks what branch we are currently on.
-
git checkout -b branch name: creates a new branch and
switches to it.
- git checkout -: Switches to the previous branch.
-
git checkout branch name: Allows you to switch to the branch
specified.
-
git log: logs all of the previous commits with their IDs &
author.
- git branch: Shows all the branches in the repository.
-
git branch -d branch name: Deletes the branch specified.
-
git add fileName: This command adds the untracked file to the
staging area.
-
git add -A: This command adds all untracked files to
the staging area.
-
git rm --cached fileName: Removes the staged files back to
being untracked.
-
git commit -m: Allows the changes made in the repository to
be saved (Must be added first).
JavaScript
-
A variable is a named container that allows us to store data in our
code.
-
Control flow is the order in which a computer executes code in a
script.
-
Although not widely used, you can replace if statements with a
switch statement.
- Functions can also be stored inside variables.
-
Variables can also be created through keywords like const and
let.
-
Arrow function expressions can be an easier way to write functions
that have a single line of code.
-
Functions can nest inside other functions. So can Arrays & For
Loops, but this can get complicated.
- There are other types of Loops you can use in JavaScript.
- You can add parameters inside the parentheses of a function.