Prework Study Guide
✨ Open the Console to See What's Happening ✨
HTML
- HTML is used to create the structure of a webpage.
- An element is a type of content on a webpage.
- elements are also used to divide the content on the page and to describe the content to browsers and other developers.
- The head element contains information about the webpage.
- The body element represents the visible content shown to the user.
- Section elements are semantic elements that define a section in a document that contains thematic content.
- Section elements are semantic elements that define a section in a document that contains thematic content.
CSS
- There are three ways to style a webpage using CSS: inline CSS, internal CSS style sheet, and external CSS style sheet.
- Inline styles apply to a specific HTML tag, using a style attribute with a CSS rule to style a particular page element only.
- An internal style sheet contains CSS rules for the webpage in the head section of the HTML file.
- the most common way to style a webpage is by using an external CSS style sheet, which allows developers to keep all their CSS rules in a separate file.
- A margin property indicates how much space we want around the outside of an element.
- The padding property adds space around the content inside an element.
- CSS files must be linked to the HTML file.
- Class attributes enable sharing a CSS rule to any element by assigning the rule to a class attribute with a class selector.
- The period preceding designates a class selector.
Git
- git is a way to write code outside of the website and add it to the website later.
- To do this you create a branch to add and edit code.
- Then you commit changes and push your work to your repository or "repo".
- Then you create a pull request so your work can be reviewed and approved.
- Once it is approved, you can merge your work with the main branch.
- git status: checks what branch we are currently on
- git checkout -b branch-name: creates a new branch and switches to it
JavaScript
- JavaScript (JS) is a high-level dynamic programming language that allows users to interact with websites.
- 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 are snippets of text that can be added along with code that the browser ignores.
- An operator is a mathematical symbol that produces a result based on two values (or variables).
- Conditionals are code structures used to test if an expression returns true or not.
- Functions are a way of packaging functionality that you wish to reuse.
- Event handlers are code structures that listen for activity in the browser, and run code in response (like a mouse click).
- Using inspect examining the console is a good way to debug code.
- A for loop uses the predictable pattern of indices to perform a task on all the items in an array by allowing a single code block to be executed over and over.
- A function is simply a set of instructions that tells the computer how to perform a certain task.
- Functions do not automatically execute when the JavaScript file.
- An array is a single variable that is used to hold a group of data.