An online markdown blog and knowledge repository.
HTML Book Chapters 4 and 15
JS Book Chapters 3
Many reasons to link, usual suspects are:
<a href="">content</a>
URL construction will depend on whether the link is internal or external:
child/page.html
.child/grandchild/gcpage.html
.../index.html
.../../index.html
.<a href='mailto:person@domain.org'>Email me!</a>
<a href='https://www.google.com' target="_blank">Google Search</a>
Same Page:
id="bookmark_name
as the tag ID that surrounds the target content.<a href="bookmark_name">here</a>
Other Page:
<div id="SummaryLinks"><div>
<a href="http://my-site.com/#SummaryLinks">Summary Links on my site</a>
Controlling the position of elements can be achieve through the following:
Note: Use the Z-index to set the "bring to front" and "send to back" equivalent effect on a box.
FLow Details:
position: static;
Causes a top-to-bottom layout of elements.position: relative;
Moves an element relative to 'normal flow' positining.
position: absolute;
Takes box out of normal flow and offsets it to absolute location. Must include a width settings.position: fixed;
Similar to absolute, relative to the browser window rather than another element. Similar offset property settings to Absolute.Overlapping Elements:
Floating Elements:
float: right;
to push the box to the right-hand side of the parent box.The zero pixels tall problem: Some browsers might treat Floated elements as if they were zero pixels tall. To solve this:
div {
overflow: auto;
width: 100%;
}
You must define these rules to <div>
elements to enable the 'column' box behavior:
width:
float:
margin:
Various computers, hand-helds, phones, etc will have different screen sizes.
Developers should take screen-size differences into account when designing a website.
Screen resolution varies from device-to-device as well, which impacts an absolute setting like px.
Page sizing is important, and good sizing decisions will help all users view a well-desgined page.
Recommendation: Stick with page widths of around 960-1000 px.
Try to capture user attention within the first 500-700px vertically on the page, and let them know there is more 'below the fold' and entice them to scroll down.
Fixed-width Layouts
Liquid Layouts
The book talks about the 12-column layout design where spanning columns is used to set box widths, thereby creating an interesting, consistent layout of elements on the page. Column widths are set specifically, and evenly to provide consistency when designing box layout.
The book also links up a pre-defined CSS file "960.gs" as a starter for designing a Layout Grid for your site.
Advantages:
Disadvantages:
Use @import
in your stylesheet to reference another stylesheet.
Reference multiple stylesheets using the Link element <link rel="stylesheet" type="text/css" href="css/mystyle.css" />
statements.
Note: When using multiple stylesheets, rules of precedence can make determining final applied style more complicated.
Note: Only cover pgs. 86-99
Functions: Perform specific actions with a block of code.
Objects: User-created items that store data in a specified format, sometimes providing properties about the data or manipulate data.
Built-in Objects: JavaScript provides some objects with members that are commonly used to perform tasks.
function myFunc (params) {
// codeblock
}
Calling a function is simple:
function logIt (message) {
console.log(message);
}
logIt('Hello World!');
When the interpreter comes to the function keyword it will store the function in memory and use 'logIt' as the custom function name.
When the interpreter continues down the code lines to the logIt(are) line, it looks up the function name 'logIt()' in memory, and supplies any argument (none in this example), and then executes the codeblock.
When the interpreter hits the last curly in the function it exits the function and returns to the end of the 'logIt()' line, and continues downward.
If a function has a variable name in its argument list, then the function must be called in the code and must include initialized variables for the argument list.
Functions that have a 'return' statement with an argument (a variable or some object), will send that variable back to the calling line of code when it exits.
The calling line of code can either ignore or store the return value from the function with a return statement.
A function can return multiple values by returning:
Named Functions are functions with a name. Anonymous Functions are functions with no name.
let funcyMessage = function(message) {
return `This is your message: "${message}"`;
}
let newMessage = funcyMessage("Hello World!") ;
IIFE: Immediately Invoked Function Expression. 'iffy'. Stores a value returned from an anonymous function.
let perimeter = (function() {
let width = 4;
let height = 5;
return width + height;
}());
// the inner parentheses after the let statement ensure the code is treated as a single block
// the final parentheses tell the interpreter to run the function immediately
When to use anonymous functions and iffys?
The above list of examples are directly quoted from [Duckett, pg97]
Globally scoped: A variable declared at the root level in a document, and not enclosed with any curly braces. Risks naming collisions in your code if not used carefully.
Locally scoped: A variable declared within a pair of curly braces is scoped to any code within those braces.
Function-level scope: A variable declared within a function can only be accessed within that function.
Performance Warning: Globally scoped variables live as long as the web page is loaded in the browser window.
Personal notes while reading the Code Fellows blog article about Paired Programming
Blog Author: [Allie Grampa]
Key takeaways:
Learning to Code:
Core skills are put to work:
Lab sessions for pair programming will take place at Code Fellows to learn and practice Paired Programming skills and processes.
Benefits include: