Prework Study Guide
✨ Open the Console to See What's Happening ✨
HTML
- The head element contains information about the webpage.
- The head element is not visable - it tells the browser what to do
- The body element represents the visible content shown to the user.
- The header element usually contains the h1 and a navigation banner
- Section elements are not visible but break up the code into different topics
- It is better to use semantic code rather than generic div elements,
although this is still done if no other solution
- h1 elements must go in order to improve accessibility
- p elements wrap text
- a elements are anchors, linking to external webpages or links to areas of the app
- img emelents are for images. they must have attributes such as href - a link to the image url
CSS
- Selectors in CSS are used to 'select what element to target
- multiple elements can be targeted at once by seperating with a comma
- padding refers to etra layer inside the element - it makes the element larger
- margin is invisible and lies outside the element. refer to css box for more info
- * {} selector targets all elements
Git
- git status: checks what branch we are currently on
- git checkout main: to revert back to main branch
- git checkout -b branch-name: creates a new branch and switches to it
- best practice to call branches feature/(what is the feature doing)
- git issues is a to do list
- we never work on the main branch
- git add -A - adds the changed files to the staging area of git
- git commit -m " - this
JavaScript
- A variable is a named container that allows us to store data in our code
- A function is a block of code designed to peform a particular task
- A function is only executed when "something" evokes or calls it
- A function can take an unlimited number of parameters
- console.log helps us debug and see what our code is doing
- Objects are arrays that can contain different data types, stored in key value pairs
- different data types include string, number, boolean, object