Prework Study Guide
✨ Open the Console to See What's Happening ✨
HTML
- The 'head' element contains the metadata for our web application
- Metadata -- data about our webapge that the browser uses to effectively serve our webage users
- The 'title' element defines the title for a webpage
- The 'style' element defines the CSS styles associated with a website
- The 'base' element defines the base URL for a webpage
- The 'link' element connects an external resource to the HTML document
- The 'meta' element defines metadata
- The 'script' element embeds client-side scripts in the HTML document
- The 'header' appears at the top of the page and usually contains a nav menu and/or intro content.
- The 'section' elemets are semantic elements that define a section in a document that contains thematic content
- The 'footer' element appears at the bottom of the page and usually contains the author, copyright, contact, sitemap, and nav.
CSS
- There are 3 ways to style a webage using CSS: inline, internal and external.
- Inline CSS -- used when a developer wants to style an element directly
- Internal style sheet -- contains rules for the webage in the head section of the HTML file.
- External style sheet -- where CSS rules are held in a separate folder.
- The 'link' element is used in the 'head' section to link to the external style sheet. 'link' uses the attributes 'rel' and 'href'
- The 'rel' attribute specifies the relationship between the current document and the linked document resource.
- The 'href' attribute specifies the location (URL) of the external resource.
- Two selectors can be used in a CSS rule by using a comma. Combining multiple selectors in a rule saves lines of code and follows the Do Not Repeat Yourself (DRY) rule.
- display:block; -- the 'display' property is assigned with the 'block' value,which assigns each item on a new line.
- 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.
Git
- The 'git' command must precede every Git statmente
- The 'checkout' command is to move the working branch to a new branch
- git status: checks what branch we are currently on
- git checkout -b branch-name: creates a new branch and switches to it
- git add -A: adds all changes in the current working branch to the staging area
- The 'pull' command recieves a branch's modifications in to the local environment
- The 'origin' keyword indicates the branch
- git pull origin main: recieves a branch called main from the GitHub repo
- git push origin branch-name: pushes the changes made in the branch to the remote GitHub branch
JavaScript
- Control flow is the order in which a computer executes code in a script.
- A variable is a named container that allows us to store data in our code.
- Array -- a strucuture that allows you to store multiples values in a single reference.
- Object -- everything in js is an object and can be stored in a variable.
- Comments -- snippets of text that can be added along with code.(// is a single line comment)(/* multi line comment */
- A for loop structure -- for(start;condition;itterate) (example)
for(var x = 0; x < shapes.length; x++){//code block}
- A function strucutre
function functionName(){//code block}