Chapter 1 and 2 Answers
- HTML code provides the structure, or the skelton, of a website.
- An element comprises the opening tag and the closing tag and any content that lies between them.
- We use attributes to provide additional information about the contents of an element.
- The head is before the body and contains information about the page and you will usually find the title inside the head element. The title element, is as it sounds a title of something. It's contents are either shown in the top of the browser or the tab for that page. Everything inside the body element is shown inside the main browser window.
- Right click and select veiw page source.
<html></html>indicates everything inside is code,<h1></h1>, main heading<h2></h2>, sub heading<b></b>, bold words<i></i>, italic words.- An empty element usaully only has one tag. Before the closing angled bracket of an empty element there will often be a space and a foward slash character
<br />or<hr /> - Semantic markup provides extra information (e.g. where emphasis should be placed, the definition of acronyms used, when given text is a quotation).
<header>,<nav>and<article>
Chapter 2 and 3 Answers
-
Ordered list are where each item on the list is numbered, just like how I'm answering the questions in this gist. Unordered list begin with a bullet point. Definition list are usually a series of terms and definitions
-
<a href="url">text or name of link<a/> -
If you want a link to open a new tab when clicked, use the
targetattribute. -
To get to a specific part of the same page, you can use the
idattribute to target elements within the page to be linked.
Chapter 10, 11 and 12 Answers
-
CSS works by associating rules to HTML elements and to indicate how the element should look.
-
Cascading Style Sheets. Cascading means that more then once styles sheet rule can apply to one HTML document.
-
The CSS rule contains two parts: a selector and a declaration. Declaration is split into two parts (property and a value) and are separated by a colon.
-
The
<link>element can be used to tell the browser where to find the CSS file used to style the page, it is an empty element and lives inside the<head>element. -
When building a site with more then one page. All of your webpages can use the same style sheet. So when you need to change how your site appears, you only need to edit one CSS file.
-
Color hex are six-digit codes that represent that amount of red, green and blue in a color. With a hash # sign at the beginning.
-
Hue, saturation and lightness
-
Serif fonts have extra details on the end fo the main strokes of the letters. Sans-serif font have straight ends to letters and therefore have a much cleaner design. Every letter in monospace typeface is the same width.
-
Pixels allow designers to control how much space their text takes up. Percantages allow to adjust the size of the default 16px in a browser. EMS an em is equivlaent to the widith of a letter m.
Chapter 7 Answers
-
The type attribute.
-
The
<select>element is used to create a drop down list box. -
The
type="submit"attribute. -
The
<fieldset>element.
Chapter 13 and 15 Answers
-
The border seperates the edge of one box to another. The margin sit outside the edge of the border where width can be adjusted to create a gap between two adjacent boxes. Padding is the space between the border of a box and any content contained within it.
-
For the CSS rule
padding: 1px 2px 5px 10pxare in a clockwise order: 1px is padding-top, 2px is padding-right, 5px is padding-bottom and 10px is padding-left. -
Elements that always appear to start on a new line in the browser are block-level. Elements that always appear to continue on the same line as thier neighboring elements are know as inline elements. The display property allows the two to have a role reversal; block can act like inline and inline can act like block.
-
The
postition:fixedis a type of absolute postitioning that requires the postition property to have a value of fixed. Howeveer, boxes can still overlap. The z-index property allows you to control which element appears on top. -
Fixed layouts use pixels and do not change size as the user increases or decreases the size of their browser window. Liquid layout uses percantages which strech and contract as the user increases or decreases the size of their browswer window.
Chapter 5 Answers
-
In an image element, the
altattribute is important because it provides a text descritption of the image which the image. -
It is determined by where you place it and what follows the
imgelement in HTML. Block elements like<h1>or<p>always appear on a new line after the image. Inline elements like<b>and<em>sit within a block level and do not start a new line after the image. -
Use a
JPGorJPEGfile to save a image when many different colors are used. The benefits of aPNGfile are used when saving images of few colors or large areas of the same color.
Chapter 16 Answers
-
Controlling the size dimensions on images in CSS will help load pages more quickly. When you use consistenlty sized images accross a site, you can us CSS to control the width and height of the images, instead of putting the dimensions in HTML.
-
When a singe image is used for several different parts of an interface, it is known as a sprite. Which can speed up the how the web page loads by only requesting one image to load.
Chapter 2 Answers
-
You can declare a variable by giving it a name
var price;. The=sign is actually an assingment operator and it assigns a value to the variableprice = 15;. -
Numeric Data Type handles numbers 0 to 9. No quotes are needed, commas are not placed in large numbers and decimals and negatives are. String Data Type consist of letter and characters in quotes. You can use single or double quotes but they must match and always be written on one line. Boolean Data Type can have one of two values, true or false.
-
Rules for Naming Variables
- Name must begin with a letter, $ or an underscore
(_). It must not start with a number. - Name can contain letters, $ or an underscore
(_). You must not use a(-)dash or a(.)period in a name. - You CANNOT use keywords or reserved words. Keywords tell the interpreter to do something and reserved words are one that may be used for future version of JavaScript.
- Variables are case sensitve.
nameandNamewould be two different variable names. However, it is bad practice to create and use both. - Use a name that best describes what the variable is storing.
- If more than one word is used, use camel case for every word after the 1st. Also, and
(_)can be used between words. Some of the reserved words you should avoid using in variable names: boolean, null, export, interface and catch.
-
When working with a list or a set of values related to each other, an array should be used. It's helpful because you dont have to specify how many values will be used. To access value of an array sepcify the indez number in square brackets
[]after the name. You can change the value of an item name by selecting it and assigning a new value using the(=)and then the new value. -
An expression is valid unit of code that evaluates into a value. A statment is an instruction to perfom a stand alone action, like creating a variable.
-
The three different types of operators are:
- Assingment operators assist the expression to assign a value to a variable.
- Arithmetic operators perform basic math calculation(s) in an expression.
- String operators combine two strings using the
(+)symbol to join the strings on either side of it to create single value/new string.
Chapter 3 Answers
-
To call a function you need to use it's full name followed by parentheses in your script. If you just typed
sayHellothe interpreter wouldn't execute the statement(s) in the code block and perform the task needed.sayHello()would call the function and"Hello!"would appear in the console. -
Peices of information to do a job are passed to a function, it is known as parameters. Inside the function the parameters act like variables. The values that you pass into the code are called arguments. Arguments can be provided as values or as variables.
-
The
returnkeword is used to value to the code that called the function. -
Local variables are used inside of a function variables used outside of a function are called global. Variables with a local scope take up less memory and also avoid naming conflicts. Global variables can be used at anytime after being declared.
- Psychology - How much work does the user have to do to get what they want?
- supporting site - Nordstrom. I love that you hover over what you want to shop and find what you need. This site is just visually pleasing for me.
- violating site - Macy's. More so on their mobile app. It takes forever to find something and it feels cluttered.
- Usability - Could you get the job done with less input from the user?
- supporting site - Alaska Airlines. I find it so easy to get around their website and their mobile app.
- violating site - Papa Murphys. When using the mobile app, you have to hit about 5 buttons to confirm what you want to order before it actually gets in your cart.
- Design - Do users think it looks good? Do they trust it immediately?
- supporting site - Denver.org. I found a lot of great info on this site when I 1st moved to Denver. Plus, no pop-up ads.
- violating site - Techterms. I like a website that has advertising that stalks me. It just looks too messy.
- Copywriting - Is it clear, direct, simple, and functional?
- supporting site - GitHub Guides. It is so easy to find what you need help with. And its very detailed help!
- violating site - The Olympian Newspaper. This paper is from my hometown. It's often very slow and won't allow you to view some content unless you are a subscriber.
- Analysis - How can you use this analysis to make improvements?
- supporting site - United Airlines. I recently flew with United and recieved an email after asking how my trip was and asked for feedback about their app and website. I like a company that is always looking for ways to improve.
- violating site - The Olympian. This one was hard to find a particular site, so I went with the newspaper again. It's just an outdated format and boring.