HTML
- The head element contains information about the webpage.
- The body element represents the visible content shown to the user.
- Declarations are not case sensitive but elements are case sensitive.
- HTML attributes are always defined in the beginning element, never the closing element.
- Elements nested inside other elements are called "child elements." Elements that hold children are called "parent elements."
- Use semantic HTML elements when possible to make HTML easier to read.
CSS
- A margin indicates how much space we want around the outside of an element.
- A padding indicates how much space we want around the content inside an element.
- Increasing padding with make the entire element bigger.
- Asterisk * is a special symbol that declares ALL elements on the page will have the style properties.
- Three Ways to Style a Webpage
- Inline CSS: Style element directly into HTML file. Useful for quick and permanent changes. Less flexible than external/internal style sheets. Each inline style must be edited individually whenever you make a design change.
- Internal Style Sheet: Embed the entire stylesheet into HTML file using style element in the head element.
- External Style Sheet: Most common; allows developers to keep all of their CSS rules in a separate file. Design changes are easier. Link the file using the link element placed in the HTML head.
- Separation of concerns; separating code into different files based on use. Each section of code should have it's own responsibility.
- You can combine selectors into CSS rule with a comma to not repeat yourself.
- DRY= Do Not Repeat Yourself; reduce overall size and complexity of code when possible.
- Class attribute; add style to certain elements but not to all elements. Can be assigned to the element in the HTML (ex. card).
Git
- Version control system used to save and track versions of code.
- Every version is assigned a unique identifer called SHA (hash).
- git status: checks what branch we are currently on
- git checkout -b branch_name: creates a new branch and switches to it
- git checkout main: switch to main
- git pull origin main: pull down main branch
- Workflow for Content Updates
- Create a branch.
- Open a pull request.
- Merge and deploy.
JavaScript
- Allows users to interact with websites.
- Browser reads code in the oder it appears in the file.
- Case sensitive.
- 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.
- /*Comments*/ //This is a comment
- Strict equality ===
- Conditionals are if/else statements.
- Functions are set of instructions that are packaged and can be reused. Must call functions by name to execute it.
- Events listen for activity and run code in response. (ex. click event)
- Undefined (absence of value; identifer); Null (absence of an object (keyword)
- Link script.js to html in 'body'.
- Chrome Dev Tools: CTRL+SHIFT+I (inspect)
- Arrays are single variables that are used to hold a group of data and can hold different types of data.
- Arrays are zero indexed and sequential.
- For loops allow single code block to be executed over and over. Must use 'if' statement to interrupt the control flow.
- For loops contain:
- Starting Point
- Condition
- Final Statement