Skip to content

Instantly share code, notes, and snippets.

@Jessmaxim303
Last active June 12, 2019 02:00
Show Gist options
  • Save Jessmaxim303/e532e07da9ec114b1d617cafcdc44d4c to your computer and use it in GitHub Desktop.
Save Jessmaxim303/e532e07da9ec114b1d617cafcdc44d4c to your computer and use it in GitHub Desktop.
Final mod 0 capstone - Jesse Maxim FE 1906

Mod 0 Capstone

Day 1: Computer Setup, HTML, and Gear Up

Read Chapters 1 and 2 on Structure and Text

1. On a website, what is the purpose of HTML code?

HTML uses elements to describe to the web browser the structure of the webpage. The best way I can describe it is that HTML is the web version of the structure of a letter. You have a <head>, then your <body> and last a <footer>. It of course it get's a little more complicated after that.

2. What is the difference between an element and a tag?

Elements are the characters that live between the opening < > and closing tags. </ > ex. <h1> Hello Turing </h1>

3. Why do we use attributes in HTML elements?

An attribute helps the element by providing extra information about the element such as font size or color.

4. Describe the purpose of the head, title, and body HTML elements.

The <head> element is where most of the data or information that you want to link to your site. The information or elements you put in the head element won't appear on the site. The <title> element if what will appear on the tab. The <body> element if where the text and images is located. Within the body is where you'll find your header elements <h1>and your paragraph elements <p>.

5. In your browser (Chrome), how do you view the source of a website?

Click View on google top menu then Click Developer then selected View Page Source.

6. List five different HTML elements and what they are used for. For example,

is a paragraph element, and it is used to represent a paragraph of text.

  • <h1> </h1> is the element for header. They range from h1 for large to h6 for small but you'll really only use h1 - h3.
  • <link> </link> is the element for linking both images and css stylesheet files.
  • <title> </title> is the element where the put the page info for the tab.
  • <div> </div> is my favorite element so far. they make a container so you can section off parts of the website.
  • <script> </script> This element allows you to add JavaScript code to html.
  • <span> </span> This allows you to add CSS code to html.

7. What are empty elements?

Empty elements don't require a closing tag. <br> would be an example of one.

8. What is semantic markup?

It the way of structuring your HTML so is reinforces the hierarchy of your content.

9. What are three new semantic elements introduced in HTML 5? Use page 431 in the book to find more about these new elements.

<form>, <table>, and <article> - Clearly defines its content.

Day 2 - HTML & CSS

Read Chapters 3 and 4 on Lists and Links from HTML and CSS: Design and Build Websites

1. There are three main types of lists in HTML: ordered, unordered, and definition. What are their differences?

Ordered lists are created by the <ol> element and will number the list for you. Unordered lists are created by the <ul> element and will have bullets points instead of numbers. Definition lists are created by the <dl> element and this is used to define a statement giving you a nested comment section.

2. What is the basic structure of an element used to link to another website?

The <a> element which has an attribute called href. That stands for Hypertext REFerence. An example would look like <a href=“www.turingschool.com">Turing School for programming</a>

3. What attribute should you include in a link to open a new tab when the link is clicked?

You will want to use to target=“_blanks” attribute open a link in a new tab.

4. How do you link to a specific part of the same page?

So very similar to how we link a website but instead of a website you’ll link a location on html. An example would be <a href=“about-us.html”> About Us </a>

Read Chapters 10, 11, and 12 on What is CSS, Color, and Text from HTML and CSS: Design and Build Websites

1. What is the purpose of CSS?

The purpose of CSS is to issue style rules for HTML elements to follow. CSS is how you add style and design to your HTML structure.

2. What does CSS stand for? What does cascading mean in this case?

CSS stands for Cascading Style Sheets. They call it cascading because the last rule takes precedence over the ladder of two conflicting rules.

3. What is the basic structure of a CSS rule?

The basic structure of a CSS rule will have a selector and a declaration. Basically a element call out and what you would like that element to do. CSS declaration will have two parts: a property is something you want to change like height, width, colors and fonts. Values are the settings like red, blue, green and font sizes. Always close rules with semicolons ; . Example:

body {
font-family: sans-serif;
color: red;
}

4. How do you link a CSS stylesheet to your HTML document?

Linking your external css files is easy using your link element. There are 3 parts, href, type and rel. HREF stands for Hypertext REFerence, so the file location. TYPE stand for what king of document are you linking. This value is text/css. REL stands for the relationship the HTML file and the file it’s linked to. Being a css file the value should be “stylesheet”. The link is also an empty element so you don’t need to close it. An example would look something like this:

<link href=“css/stylesheet.css” type=“text/css” rel=“stylesheet” />

5. When is it useful to use external stylesheets as opposed to using internal CSS?

It is good practice to always use external stylesheets. It keeps everything clean and easy to look at. It also is very beneficial when creating websites with multiple pages so you don’t have to create multiple css files. It’s also easier to keep track of brand standards when all style code is in one place.

6. Describe what a color hex code is.

Hex code for color is a six digit code that represents red, green and blue. It is always preceded by the pound # sign.

7.What are the three parts of an HSL color property?

HSL stands for Hue, Saturation and Lightness.

8. In the world of typeface, what are the three main categories of fonts? What are the differences between them?

Serif have a little extra detail to help them make them easier to read. Sans-Serif have more of a straight and cleaner look. Monospace is font that has the same width between them.

9. When specifying font-size, what are the main three units used?

Pixels: This allows you to get really precise. Percentages: this allows you to base the text off a percent of the default text. EMS: This is spacing based off your current font size for the letter m.

Day 3 - HTML & CSS

Read Chapter 7 on Forms from HTML and CSS: Design and Build Websites

1. If you're using an input element in a form, what attribute controls the behavior of that input?

That would be the type attribute. type=“ ” There are many type attributes that you can choice when using the input element.

2. What element is used to create a dropdown list?

You would use the <select> element to create to dropdown list then you will use the <option> element to create different options for the user to pick from.

3. If you're using an input element to send form data to a server, what should the type attribute be set to?

You will want to use the type="Submit" attribute to send the information to the server.

4. What element is used to group similar form items together?

Grouping items together can be done with the <fieldset> element. Within the element you can use the element to identify the groups in the form.

Read Chapters 13 and 15 on Boxes and Layout from HTML and CSS: Design and Build Websites

1. Describe the differences between border, margin, and padding.

Every box will have a border. Think of this as the edge of the container. The padding is the space between the content and the edge of container. The margin the the space bbeyond the border.

2. For a CSS rule padding: 1px 2px 5px 10px, what sides of the content box does each pixel value correspond to?

The will appear in a clockwise rotation. Starting with the top, right, bottom and last left.

3. Describe the difference between block-level and inline elements.

Block level will stack boxes on top of each other even if the space allows. Inline element will let other elements and boxes move and flow around them.

4. What is the role of fixed positioning, and why is z-index important in the scenario of using fixed positioning?

When your using a fixed positioning on a box that box won’t move even when the page is scrolled. Z-index is important for allowing you to control what element sits on tops. It can get important when you have a lot of boxes on a page. The element with the highest z-index number will sit on top.

5. What is the difference between a fixed and liquid layout?

A fixed width layout is one that will not change regardless of the size of the browser window. This is beneficial for designer who want to use pixels for more control over the position and appearance. Although not helpful if you plan on users using different screen sizes. In that case you would want to use more of a Liquid style layout. If a fixed width layout is based on pixels than a liquid layout is based of percents, so the page will always be 100% of screen size.

Day 4: HTML, CSS, and JavaScript

Read Chapter 5 on Images HTML from HTML and CSS: Design and Build Websites

1. In an image element, why is the alt attribute important?

The alt section allows you to add text to an image that might not be able to be displayed.

2. What determines if an image element is inline or block?

The placement of where you add the image code will determine if the box will be a block or inline element. If the code sits on top or bottom of text or box it will be a block. If the code sits in or nest within a box it would become an inline element.

3. What are the benefits of jpg or png image file formats?

For the most part most images that you will use or encounter will be in the .jpg format. It’s the format that handles photos and color better. .png are very helpful when it comes to being able images with transparent sections like most logos. Pngs are also good for more simple images that only use single colors like icons and infographics.

Read Chapter 16 on Images CSS from HTML and CSS: Design and Build Websites

1. What is the benefit of specifying the height and width of images in CSS compared to specifying in the HTML?

When you specify the height and width on CSS rather than HTML it allows you to keep the dimensions off your HTML page, which should be kept clean. It also helps when loading the page to increase speed.

2. What is an image sprite, and why is it useful?

When you are using the same images in several different area on a webpage that is called a sprite. The huge advantage to using sprites is that it allows the webpage to only have to load one images cutting down page load time.

Day 5: JavaScript

Read Chapter 2 (Statements, Variables, Data Types, & Arrays) from JavaScript & jQuery: Interactive Front-End Web Development

1. How do you declare a variable. What does the equals sign really mean in JavaScript? What is it called in JavaScript?

To declare a variable you will want to use var as the keyword for variable and then declare what you would like for the identifier. An example would look like var maximBaby = 1 The equal sign is the statement operator or in JavaScript it’s called the assignment operator. It is used to assign values to variables.

2. There are three big data types in JavaScript: numbers, strings, and booleans. Describe what each of them are.

Numbers are often called numeric data types and as the name suggests it’s handles numbers both positive and negative. We use this data type when trying to calculate sizes and things like setting the amount of time something can fade in. Strings are how a variable can store a sequence of characters. You will add quote marks around the text. This is used when displaying an users name on a greeting or any type of message. Booleans can only hold a value of either true or false. Booleans are an important part to any site because allow different outcomes. If true give one response if false give another.

3. What are the six rules for naming variables? What are a few JavaScript reserved words that you should avoid using for variable names?

1). A name must start with a letter, dollar sign or an underscore.
2). A name can only contain letters, dollar signs or an underscore. Don’t use dashes or periods.
3). You cannot use words that are names for variables, functions, methods, or objects as these will give instruction to do something. When we are making a variable we would use the keyword var. Boolean, true, false, and import are some a few other examples of words that are reserved functions.
4). Variables are case sensitive so names like mybike and myBike will be different. You want to stay away from creating variables with the same name and different cases as this might be hard to remember when using them.
5). Instead you want to use a name that help describes the information for that variable like myBike or currentSpeed.
6). When using different cases to separate words you will not capitalize the first word. When you do this it’s called camel case. Keywords that you would want to stay away from are things like the two booleans true and false, float for positioning, and undefined as these words are reserved for an action.

4. How can an array be useful when dealing with multiple related values? How do you access/change a value in an array?

An array is helpful when working with multiple related values because it will allow you to store them as a list. You can create an array and store numbers, strings, and booleans. When you create an array it will also create an index for each value starting at 0.

var bikes;
bikes = [‘yeti’,
         ‘santa cruz’,
         ‘custom’]

This makes it easy to update a value by using the index to call out the value that you would like to change. bikes [2] = ‘reeb’ will change the custom value to reeb.

5. What is the difference between an expression and a statement?

A statement is a complete instruction or step and an expression is the section of code that will formulate a value.

6. What are three types of operators and how are they used?

Assignment operators: These will assign a value to a variable. Arithmetic operators: these will perform a basic math. String operators: these will combine string together.

Day 6: JavaScript, Terminal, Git, and GitHub

1). If we have a function defined as function sayHello(){console.log("Hello!")}, what is the difference between entering sayHello and sayHello() in the console

Functions will sometimes need to provide information in order to run a task. The information inside the parentheses is called parameters.

2). What is the difference between function parameters and arguments?

A parameter is when you use words inside the parentheses and those words will act like a variable. An argument is the value used within the function.

3). What is the keyword return used for?

The return keyword will return the information to the function that called it.

4. How are local variables better than global variables? Are there instances you can think of where you might want to use a variable that is globally scoped over local?

A local variable is one that is placed inside the function. Doing so will remove the variable after thew function uses it. A global variable is one declared outside of a function and can be used by different functions with the same value. A global variable would be beneficial when you need to use that variable over multiple locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment