Reading Notes
Links
<a></a>
tags<a href="http://www.imdb.com">IMDB</a>
<a href="http://www.imdb.com">
opening link tag"http://www.imdb.com"
page that link takes you toIMDB
text the user clicks on</a>
closing link tagURL Uniform Resource Locator
Email Links
mailto:
link that starts up email program and pre-addresses the email
<a href="mailto:john@example.org">Email John</a>
clicking on john will open an email addressed to johnOpening Link in New Window
<a href = "http://www.idb.com" target="_blank">IMDB</a>
clicking on IMDB will open it in a new windowLinking to other parts of the same page
id="example"
<a href="#example">Link to Example part of page</a>
clicking the link will take the user to the element with id exampleLinking to specific part of another page
<a href="http://www.website.com#id">Website at location with element id</a>
will take user to website at the location of the element with idControlling the Position of Elements
Z-index property determines which box appears on top when out of normal flow and overlapping
Fixed Width Layouts
Liquid Layouts
Layout Grid
CSS Frameworks provide code for common tasks like creating layout grids
Functions allow programmer to group a series of statements together to perform a specific task
{code block}
Code blocks contain a series of related steps contained between two curly braces}Declaring a Function give it a name and then write its statements needed to achieve its tasks inside the curly braces
()
{}
function sayHello() {
document.write('Hello!');
}
function
= Function KeywordsayHello()
= Function Name{document.write('Hello!');}
= Code BlockCalling a Function can execute all of the statements between a functions curly braces with just one line of code in the location that programmer desires
();
sayHello();
Declaring functions that need information give a function information by providing parameters
()
after the function name
function getArea(width,height) {
return width * height;
}
width, height
= Parameters used like variables inside a functionCalling a Function that needs information specify the values it should use in the ()
following the name, these values are called arguments
getArea(3,5);
wallWidth = 3;
wallHeight = 5;
getArea(wallWidth,wallHeight);
Getting a single value out of a function “returning a result”
function calculateArea(width, height) {
var area = width * height;
return area;
}
var wallOne = calculateArea(3,5);
var wallTwo = calculateArea(8,5);
wallOne
variable now holds 15wallTwo
variable now holds 40Note: when the interpreter hits the return command it goes back to the statement that called it, subsiqent statements in the function would not be processed
Variable Scope location of where a variable is declared will effect where it can be used