Скачать презентацию HTML 5 Seminar Ga Tech March 31 2012 Скачать презентацию HTML 5 Seminar Ga Tech March 31 2012

0ab2cf26040de76b9aa97215eeb2c70c.ppt

  • Количество слайдов: 99

HTML 5 Seminar Ga Tech March 31, 2012 Barbara Ericson Barbara Fox HTML 5 Seminar Ga Tech March 31, 2012 Barbara Ericson Barbara Fox

We all start here. . . http: //www. datamation. com/img/2009/07/art-programming. jpg We all start here. . . http: //www. datamation. com/img/2009/07/art-programming. jpg

CSS for styling colors, position, fonts CSS for styling colors, position, fonts "HTML 5" HTML tags and attributes whales. htm Learn About Whales Whales

Whales are mammals.

Orca Whale
wstyle. css body { background-color: gray } h 2 { color: white } Java. Script for interactivity and flexibility whales. js function init() { var w = document. get. Element. By. Id("orca"); w. inner. HTML = "Black & white whale"; } window. onload = init;

. . . and it looks like this <title> CSS changed background color to . . . and it looks like this CSS changed background color to gray and "Orca Whale" to white Java. Script added "Black and white whale" inside of the <div> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="What will I have to change when moving from HTML 4 to HTML 5?" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-5.jpg" alt="What will I have to change when moving from HTML 4 to HTML 5?" /> What will I have to change when moving from HTML 4 to HTML 5? </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="HTML 4 vs. HTML 5 <!DOCTYPE html PUBLIC "-//W 3 C//DTD HTML 4. 01//EN"" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-6.jpg" alt="HTML 4 vs. HTML 5 <!DOCTYPE html PUBLIC "-//W 3 C//DTD HTML 4. 01//EN"" /> HTML 4 vs. HTML 5 <!DOCTYPE html PUBLIC "-//W 3 C//DTD HTML 4. 01//EN" "http: //www. w 3. org/TR/html 4/strict. dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Learn About Whales Learn About Whales. . .

HTML 4 vs. HTML 5 <!DOCTYPE html PUBLIC HTML 4 vs. HTML 5 Learn About Whales Learn About Whales. . .

HTML 4 vs. HTML 5 <!DOCTYPE html PUBLIC HTML 4 vs. HTML 5 Learn About Whales Learn About Whales . . .

HTML 4 vs. HTML 5 <!DOCTYPE html PUBLIC HTML 4 vs. HTML 5 Learn About Whales Learn About Whales

HTML 4 vs HTML 5 whales. htm • simplifies document markup <!doctype html> <meta HTML 4 vs HTML 5 whales. htm • simplifies document markup wstyle. css • Must use CSS for all appearance styling • CSS 3 • adds styles like drop shadows and rounded borders • adds selector options • adds new element tags for greater semantic content • deprecates tags and attributes that were used primarily for styling appearance vs. semantic content whales. js API's which add Java. Script functionality: Video, Canvas, Local Storage, Audio, Forms, Drag & Drop, Geolocation, Sockets, Web Workers, Offline Caching

Deprecated HTML tags <applet> <frame> <font> <center> <u> For complete list see: http: //www. Deprecated HTML tags
For complete list see: http: //www. tutorialspoint. com/html 5_deprecated_tags. htm

Deprecated HTML attributes Attributes removed from most elements: align background bgcolor border cellpadding cellspacing Deprecated HTML attributes Attributes removed from most elements: align background bgcolor border cellpadding cellspacing width For complete list see: http: //www. tutorialspoint. com/html 5_deprecated_tags. htm

Whales Whales HTML 4 vs. HTML 5 Move all styling to CSS Whales

Whales are mammals.

Orca Whale
body { background-color: gray } h 2 { color: white } whales. htm whales. css

"HTML 5" Java. Script API's l l Geolocation Forms identify browser location can require certain fields filled in; verify email, URL's or phone numbers l Web Workers manage multiple scripts running concurrently and in the background to avoid lags l l Local Storage Canvas store info on desktop computer draw text, images, lines, circles, rectangles, patterns, and gradients l l Audio & Video more advanced features Offline Web Apps Applications which will work even when not connected to the web

Lab 1: Convert HTML 4 to HTML 5 l l Copy Lab 1. zip Lab 1: Convert HTML 4 to HTML 5 l l Copy Lab 1. zip to your computer & unzip it Using code from Power. Point slides: l l l Convert whale. htm to HTML 5 Move color styling to CSS View whale. htm in your browser to verify it renders properly

Introduction to HTML Skip HTML, jump to Lab 1 Introduction to HTML Skip HTML, jump to Lab 1

HTML Tags l l l Begin with < End with > Tagname in the HTML Tags l l l Begin with < End with > Tagname in the middle < tagname > Identify the structure of the content (paragraph, image, link, heading, etc. ) If a tag contains content (text, other tags, etc. ) then it will have a closing tag

HTML Attributes l l l Provide additional information Located inside an opening tag Syntax HTML Attributes l l l Provide additional information Located inside an opening tag Syntax attributename="value of attribute"

. . . . . ." src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-19.jpg" alt="Basic HTML Structure . . . . . ." /> Basic HTML Structure . . . . . . The doctype declaration is not usually referred to as a tag. Which are tags? Name the attribute: lang What is the value of that attribute? "en"

. . . . . ." src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-20.jpg" alt="Basic HTML Structure . . . . . ." /> Basic HTML Structure . . . . . . required first line according to HTML 5 HTML web page in English top portion contains and other non-content related items visible "contents" of the web page </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Common HTML Tags in <head> <title> <meta charset="utf-8"> <script src="javascript. js"> <link rel="stylesheet" href="mycss." src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-21.jpg" alt="Common HTML Tags in <head> <title> <meta charset="utf-8"> <script src="javascript. js"> <link rel="stylesheet" href="mycss." /> Common HTML Tags in <head> <title> <meta charset="utf-8"> <script src="javascript. js"> <link rel="stylesheet" href="mycss. css"> typically shows in browser tab or when minimized character-set external Javascript file external CSS defining colors, fonts, etc. <head> <title>Whale Info

Common text tags in <body> <p> paragraph <h 1> <h 2> <h 3> <h Common text tags in

paragraph Heading 1 (Major Heading) Sub. Heading (subheading of ) sub-Sub. Heading (subheading of ) sub. . . sub sub. . . smallest sub-heading

    1. Unordered list - list items inside will have bullets in front of them Ordered lists - list items inside will be numbered individual item in a list (either ordered or unordered) Mammals Whales
      • Orca
      • Beluga
      • Humpback

HTML Miscellaneous Comments <!-- This is a comment. It is ignored by the browser HTML Miscellaneous Comments Nesting Tags should be nested inside of each other like nesting dolls. To opening tag and closing tag create a "box" that contains other information.

Beginning of a paragraph

  1. Orca
  2. Beluga
be l> should he BEF ith < ended w /p> agraph < par

Try It Nesting Check This HTML is not nested properly. Write down the correct Try It Nesting Check This HTML is not nested properly. Write down the correct HTML. Indent to make the nesting more clear. . Favorite Foods

    Pizza Cake
  1. Cookies
  • Sushi
  • Nesting Solution <h 3>Favorite Foods</h 3> <ol> <li>Pizza</li> <li>Cake</li> <li>Cookies</li> <li>Sushi</li> </ol> Nesting Solution Favorite Foods

    1. Pizza
    2. Cake
    3. Cookies
    4. Sushi

    Spacing in HTML Block tags start on a new line and do a line Spacing in HTML Block tags start on a new line and do a line break when finished:

    , , , , , , ,

      ,
        ,
      • ,

        Images l l Embed jpg, gif, and png images into web page Image tags Images l l Embed jpg, gif, and png images into web page Image tags require the use of attributes Baby Beluga Whale n src - locatio of image file y t will displa ate text tha any reason alt - altern display for nnot if picture ca Baby Beluga Whale src - location of image file o n internet beg ins with http: / / alt - alternate text required for federal ac cessibility law s

        Lab 2 Create website Create a 2 -page web site about another teacher in Lab 2 Create website Create a 2 -page web site about another teacher in the room 1. l l 2. 3. 4. 5. Create new folder/link called lab 2 to hold the files Create home page: index. htm Create second page: interests. htm Add proper HTML 5 info in In add a In <body> add headings, lists, paragraphs, images, and a link to an external website Link index. htm and interests. htm to each other Note: Workshop site: http: //coweb. cc. gatech. edu/ice-gt --> Teacher Workshops New links created with asterisks: *lab 2* </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Common HTML Attributes src="playlist. js" src="marathon. jpg" embeds the contents of this file into" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-30.jpg" alt="Common HTML Attributes src="playlist. js" src="marathon. jpg" embeds the contents of this file into" /> Common HTML Attributes src="playlist. js" src="marathon. jpg" embeds the contents of this file into the web page href="playlist. css" href="http: //google. com" hyperlink reference to an external file id="first" a unique identification for an element so it is easy to refer to it with HTML, CSS, or Java. Script class="whale" an identifier than can refer to multiple elements to make it easy to refer to those elements with HTML, CSS, or Java. Script </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Tables <table> <tr> <th> <td> table row column or row heading cell (table heading)" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-31.jpg" alt="Tables <table> <tr> <th> <td> table row column or row heading cell (table heading)" /> Tables <table> <tr> <th> <td> table row column or row heading cell (table heading) regular cell (table data) 1 st row - table headings 2 nd, 3 rd, & 4 th row - table data </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="<table> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> <td>Sperm" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-32.jpg" alt="<table> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> <td>Sperm" /> <table> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> <td>Sperm Whale</td> <td>60 feet</td> <td>50 tons</td> </tr> <td>Killer Whale</td> <td>30 feet</td> <td>5 tons</td> </tr> </table> with No CSS Styling with CSS Styling </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Tables - additional tags <caption> Table caption <thead> Groups the header content <tbody> Groups" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-33.jpg" alt="Tables - additional tags <caption> Table caption <thead> Groups the header content <tbody> Groups" /> Tables - additional tags <caption> Table caption <thead> Groups the header content <tbody> Groups the body content <tfoot> Groups the footer content <colgroup> Defines a group of columns in a table (makes it easier to apply CSS) <col> Used with colgroups to define styles for columns </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Tables - HTML 5 attributes Removed width, cellspacing, cellpadding, and others Only supported attribute" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-34.jpg" alt="Tables - HTML 5 attributes Removed width, cellspacing, cellpadding, and others Only supported attribute" /> Tables - HTML 5 attributes Removed width, cellspacing, cellpadding, and others Only supported attribute is: border="" border=1 No border on </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Tables - add'l context tags <table> <thead> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> </thead> <tbody>" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-35.jpg" alt="Tables - add'l context tags <table> <thead> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> </thead> <tbody>" /> Tables - add'l context tags <table> <thead> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> </thead> <tbody> <tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> . . . </tbody> </table> <style> table { border: 15 px solid navy; border-collapse: collapse; } th, td { border: 1 px solid black; padding: 10 px; } thead { font-family: sans-serif, arial; text-transform: uppercase; border: 5 px solid gray } </style> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Tables - colgroup l Create groups columns for styling <style>. whaleinfo{background-color: Light. Sky. Blue;" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-36.jpg" alt="Tables - colgroup l Create groups columns for styling <style>. whaleinfo{background-color: Light. Sky. Blue;" /> Tables - colgroup l Create groups columns for styling <style>. whaleinfo{background-color: Light. Sky. Blue; width: 300 px}. whale {width: 100 px}. . . </style> <table> <colgroup> <col class="whale"></col> <col class="whaleinfo"></col> <colgroup>. . . </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Lab 2 B Add a table l Add a table to the teacher website" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-37.jpg" alt="Lab 2 B Add a table l Add a table to the teacher website" /> Lab 2 B Add a table l Add a table to the teacher website Note: This page will still have boring black text and the pictures will be sized poorly. That's ok! We can dress it up later with CSS. </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Form Elements - text + button <form> <input type="text" id="song. Text. Input" size="40" placeholder="Song" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-38.jpg" alt="Form Elements - text + button <form> <input type="text" id="song. Text. Input" size="40" placeholder="Song" /> Form Elements - text + button <form> <input type="text" id="song. Text. Input" size="40" placeholder="Song name"> <input type="button" id="add. Button" value="Add Song"> </form> Later we'll be creating Java. Script that will respond to the button click and read the text input </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Form Elements - radio buttons <form> <input type="radio" name="size" value="small" />Small <input type="radio" name="size"" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-39.jpg" alt="Form Elements - radio buttons <form> <input type="radio" name="size" value="small" />Small <input type="radio" name="size"" /> Form Elements - radio buttons <form> <input type="radio" name="size" value="small" />Small <input type="radio" name="size" value="medium" />Medium <input type="radio" name="size" value="large" />Large </form> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Form Elements - drop downs <form action=""> <label>Select your favorite car</label> <select name="cars"> <option" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-40.jpg" alt="Form Elements - drop downs <form action=""> <label>Select your favorite car</label> <select name="cars"> <option" /> Form Elements - drop downs <form action=""> <label>Select your favorite car</label> <select name="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat" selected="selected">Fiat</option> <option value="audi">Audi</option> </select> </form> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Form Elements check box and Submit button <form> <input type="checkbox" name="vehicle" value="bike" />bicycle <input" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-41.jpg" alt="Form Elements check box and Submit button <form> <input type="checkbox" name="vehicle" value="bike" />bicycle <input" /> Form Elements check box and Submit button <form> <input type="checkbox" name="vehicle" value="bike" />bicycle <input type="checkbox" name="vehicle" value="car" />automobile <input type="checkbox" name="vehicle" value="bus" />bus <input type="submit" value="Submit" /> </form> Submit sends the input from the form to a web server for processing </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Lab 2 C Add a form to your teacher website which includes: l input" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-42.jpg" alt="Lab 2 C Add a form to your teacher website which includes: l input" /> Lab 2 C Add a form to your teacher website which includes: l input type="text" (ask for student name) l button (Add a Song, Add a Class, etc. ) l radio buttons (age, gender, etc. ) l checkboxes (favorite foods) l submit button Note: This page will still have boring black text and the pictures will be sized poorly. That's ok! We can dress it up later with CSS. </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Div <div> l Divisions are used to separate sections of a web page for" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-43.jpg" alt="Div <div> l Divisions are used to separate sections of a web page for" /> Div <div> l Divisions are used to separate sections of a web page for l l l styling (colors, fonts, etc. ) positioning on the page Contextual sections should be specified using the new HTML 5 tags: <section> <article> <header> <hgroup> <footer> <nav> <aside> sports, news, ads Cure For Cancer Atlanta Journal + logo group of headers for one topic page number, contact links navigation links pullout </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Using <div> <div id="header"> <div id="links"> <div id="main. Content"> <div id="article"> <div class="sidebar"> <div" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-44.jpg" alt="Using <div> <div id="header"> <div id="links"> <div id="main. Content"> <div id="article"> <div class="sidebar"> <div" /> Using <div> <div id="header"> <div id="links"> <div id="main. Content"> <div id="article"> <div class="sidebar"> <div id="footer"> diagram from www. cengagesites. com/. . . /Transitioning to HTML 5 and CSS 3)Patrick Carey. ppt </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Using HTML 5 elements <header>id="header"> <div … </header> <nav> … </nav> <div id="links"> <section>" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-45.jpg" alt="Using HTML 5 elements <header>id="header"> <div … </header> <nav> … </nav> <div id="links"> <section>" /> Using HTML 5 elements <header>id="header"> <div … </header> <nav> … </nav> <div id="links"> <section> … </section> <div id="main. Content"> <article> <div …</article> id="article"> <div class="sidebar"> <aside> … </aside> <footer> … </footer> <div id="footer"> Note: Not block elements like <div>. Can change to block element behavior with CSS display: block diagram from www. cengagesites. com/. . . /Transitioning to HTML 5 and CSS 3)Patrick Carey. ppt </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Div div id="info" div id="photos" " src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-46.jpg" alt="Div div id="info" div id="photos" " /> Div div id="info" div id="photos" </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Div <div id="info"> <h 1>Animal Report</h 1> <h 2>Mammals </h 2> <h 3>Water mammals</h" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-47.jpg" alt="Div <div id="info"> <h 1>Animal Report</h 1> <h 2>Mammals </h 2> <h 3>Water mammals</h" /> Div <div id="info"> <h 1>Animal Report</h 1> <h 2>Mammals </h 2> <h 3>Water mammals</h 3> <img src="whale. Clipart 2. jpg"> <h 4>Whales</h 4> <h 5>Beluga whales</h 5> <h 6>Feeding habits of belugas</h 6> </div> <div id="photos"> <img src="beluga. jpg"> <img src="baby. Beluga. jpg"> </div> Two divisions are created </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Div #photos { height: 250 px; width: 650 px; background-color: gray; border: 10 px" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-48.jpg" alt="Div #photos { height: 250 px; width: 650 px; background-color: gray; border: 10 px" /> Div #photos { height: 250 px; width: 650 px; background-color: gray; border: 10 px solid black } #photos img { margin: 20 px; border: 5 px solid white; height: 200 px } only div id="photos" is affected by the CSS styling </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-49.jpg" alt="" /> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Solution " src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-50.jpg" alt="Solution " /> Solution </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Introduction to CSS Skip CSS, jump to Lab 2 " src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-51.jpg" alt="Introduction to CSS Skip CSS, jump to Lab 2 " /> Introduction to CSS Skip CSS, jump to Lab 2 </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS l l Cascading Style Sheets Control the appearance or style of the web" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-52.jpg" alt="CSS l l Cascading Style Sheets Control the appearance or style of the web" /> CSS l l Cascading Style Sheets Control the appearance or style of the web page l l l color, font, border width, height, position margin, padding </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS l Inline CSS l l l Internal CSS aka Embedded CSS l l" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-53.jpg" alt="CSS l Inline CSS l l l Internal CSS aka Embedded CSS l l" /> CSS l Inline CSS l l l Internal CSS aka Embedded CSS l l affects one line of HTML located within an HTML tag affects one web page located in the <head> <style>. . </style> External CSS l l affects multiple pages of a web site located in an external file and linked to each page with the <link> tag in <head> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS - w 3 schools. com " src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-54.jpg" alt="CSS - w 3 schools. com " /> CSS - w 3 schools. com </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS - inline l Inline CSS l l l affects one line of HTML" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-55.jpg" alt="CSS - inline l Inline CSS l l l affects one line of HTML" /> CSS - inline l Inline CSS l l l affects one line of HTML located within an HTML tag no selector since it is inside a tag <h 2 style="color: teal">Teal</h 2> <h 2>Not teal</h 2> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS - internal l Internal CSS aka Embedded CSS l l l affects one" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-56.jpg" alt="CSS - internal l Internal CSS aka Embedded CSS l l l affects one" /> CSS - internal l Internal CSS aka Embedded CSS l l l affects one web page located in <head> To change ALL <h 2> <style> h 2 { color: teal; background-color: yellow } </style> <h 2 id="orca">Killer Whale</h 2> <h 2> Beluga</h 2> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS - external l External CSS l l l affects every web page that" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-57.jpg" alt="CSS - external l External CSS l l l affects every web page that" /> CSS - external l External CSS l l l affects every web page that include <link> to the CSS file Do NOT specify <style> <link> is in <head> of web page <!-- This is the file whale. htm --> <head> <link rel="stylesheet" href="whale. css"> </head> <body> <h 2 id="orca">Killer Whale</h 2> <h 2> Beluga</h 2> </body> /* This is the file whale. css */ h 2 { color: teal; background-color: yellow } </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS with ids l l The HTML attribute id=" " is used to uniquely" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-58.jpg" alt="CSS with ids l l The HTML attribute id=" " is used to uniquely" /> CSS with ids l l The HTML attribute id=" " is used to uniquely identify an HTML element so Java. Script, CSS, and other HTML can refer to it #idname is the CSS selector for an id <h 2 id="orca">Killer Whale</h 2> <h 2> Beluga</h 2> <style> h 2 { color: red; } #orca { background-color: Light. Blue } </style> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS with classes l l The HTML attribute class=" " is used to identify" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-59.jpg" alt="CSS with classes l l The HTML attribute class=" " is used to identify" /> CSS with classes l l The HTML attribute class=" " is used to identify multiple HTML elements so Java. Script, CSS, and other HTML can refer to them easily. classname is the CSS selector for a class . whale { color: red; } <h 1 class="whale">Killer Whale</h 1> <p class="whale">Another name for a killer whale is an orca</p> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="<table> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> <td>Sperm" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-60.jpg" alt="<table> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> <td>Sperm" /> <table> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> <td>Sperm Whale</td> <td>60 feet</td> <td>50 tons</td> </tr> <td>Killer Whale</td> <td>30 feet</td> <td>5 tons</td> </tr> </table> with No CSS Styling with CSS Styling </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="<table> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> <td>Sperm" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-61.jpg" alt="<table> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> <td>Sperm" /> <table> <tr> <th>Whale</th> <th>Length</th> <th>Weight</th> </tr> <td>Blue Whale</td> <td>100 feet</td> <td>150 tons</td> </tr> <td>Sperm Whale</td> <td>60 feet</td> <td>50 tons</td> </tr> <td>Killer Whale</td> <td>30 feet</td> <td>5 tons</td> </tr> </table> <style> table { border: 5 px solid red; border-collapse: collapse; } th, td { border: 1 px solid black; padding: 10 px; } </style> with CSS Styling </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS 3 - border-radius #whale { width: 400 px; height: 250 px; background-color: Light." src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-62.jpg" alt="CSS 3 - border-radius #whale { width: 400 px; height: 250 px; background-color: Light." /> CSS 3 - border-radius #whale { width: 400 px; height: 250 px; background-color: Light. Sky. Blue; padding: 15 px; border-radius: 20 px; } #whale img { width: 50%; border: 15 px solid gray; border-radius: 15 px } <div id="whale"> <h 1>Whales<h 1> <img src="baby. Beluga. jpg"> </div> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="CSS 3 - drop shadows #blurred { background-color: Light. Sky. Blue; box-shadow: 10 px" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-63.jpg" alt="CSS 3 - drop shadows #blurred { background-color: Light. Sky. Blue; box-shadow: 10 px" /> CSS 3 - drop shadows #blurred { background-color: Light. Sky. Blue; box-shadow: 10 px 5 px gray; } #sharp { background-color: Light. Sky. Blue; box-shadow: 10 px black; } <h 1 id="blurred">Blurred<h 1> <h 1 id="sharp">Sharp</h 1> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Lab 2 D l l Create a CSS file called lab 2. css in" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-64.jpg" alt="Lab 2 D l l Create a CSS file called lab 2. css in" /> Lab 2 D l l Create a CSS file called lab 2. css in the labs folder Add the following line in the <head> section of index. htm and interests. htm: <link rel="stylesheet" href="lab 2. css"> l Change the styling (See example CSS on next page or http: //w 3 schools. com to be more creative) </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Sample lab 2. css /* lab 2. css */ body { background-color: gray }" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-65.jpg" alt="Sample lab 2. css /* lab 2. css */ body { background-color: gray }" /> Sample lab 2. css /* lab 2. css */ body { background-color: gray } h 2 { color: red } h 3 { text-align: center} img { border: 9 px solid blue; width: 200 px } p { font-style: italic } a: hover {color: blue} /* hover link color */ </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="What can you do with Java. Script? " src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-66.jpg" alt="What can you do with Java. Script? " /> What can you do with Java. Script? </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Three places to add Java. Script <head> internal script - put in <head> section" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-67.jpg" alt="Three places to add Java. Script <head> internal script - put in <head> section" /> Three places to add Java. Script <head> internal script - put in <head> section <script> Java. Script statement(s) external Java. Script file </script> <script src="mycode. js"> </script> </head> <body> <script> Java. Script statement(s) inline script - put in <body> section </script> <body> </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Make a statement Store a value in a variable Add comments var temp=98. 6;" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-68.jpg" alt="Make a statement Store a value in a variable Add comments var temp=98. 6;" /> Make a statement Store a value in a variable Add comments var temp=98. 6; // fahrenheit var first. Name = "Adam"; var last. Name = "Zigler"; temp = (temp - 32) * 5 / 9; var fullname = first. Name + " " + last. Name; Do math Concatenate strings var random. Num = Math. random(); var count=5; count=count+1; Use functionality built into Java. Script Add one to an existing variable </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Pop up an alert window alert("Please enter a song"); " src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-69.jpg" alt="Pop up an alert window alert("Please enter a song"); " /> Pop up an alert window alert("Please enter a song"); </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Try It Simulate a baseball game. Create home. Score with value of 10 Create" src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-70.jpg" alt="Try It Simulate a baseball game. Create home. Score with value of 10 Create" /> Try It Simulate a baseball game. Create home. Score with value of 10 Create visitor. Score with value of 8. Pop up an alert stating "Game Over" Challenge: Pop up an alert that prints the current scores Hint: "n" prints a newline </p> </div> <div style="width: auto;" class="description columns twelve"><p><img class="imgdescription" title="Solution <head> <title>Learn Java. Script

        Do things more than once (while loop) bean. Counter = 5; while (bean. Counter Do things more than once (while loop) bean. Counter = 5; while (bean. Counter > 0 ) { alert("Dropped a bean"); bean. Counter = bean. Counter - 1; }

        Do things more than once (for loop) var weight=130; for (scoops = 0; scoops Do things more than once (for loop) var weight=130; for (scoops = 0; scoops < 10; scoops++) { weight=weight+1; } This loop will execute 10 times ( 1 st Iteration: scoops = 0 2 nd iteration: scoops = 1. . . 9 th iteration: scoops = 8 10 th iteration: scoops = 9 then scoops=10 so loop exits weight=131 weight=132 weight=139 weight=140

        Try It Simulate strikeouts with a for loop. Alert popups that say: Strike 1 Try It Simulate strikeouts with a for loop. Alert popups that say: Strike 1 Strike 2 Strike 3 You're out

        Solution <script> for (strike = 3; strike >0; strike--) { alert( Solution

        Make decisions and get input from popup prompt var name=prompt( Make decisions and get input from popup prompt var name=prompt("Please enter your name", "Jane Doe"); if (name!=null && name!="") { alert("Thank you, " + name) } else { alert("Name entered improperly"); } != "" && not equal empty string AND (both conditions must be true)

        DOM - Document Object Model My awesome playlist

        html head title body h 1 ul id="playlist" li id="song 1" li id="song 2" li id="song 3" p. 82

        Java. Script code samples http: //www. blogohblog. com/wp-content/pop/2008/07/funnyjavascript. gif Java. Script code samples http: //www. blogohblog. com/wp-content/pop/2008/07/funnyjavascript. gif

        Before changing DOM, page must be completely loaded This function changes the value of Before changing DOM, page must be completely loaded This function changes the value of an existing HTML element function init() { var nm = document. get. Element. By. Id("name"); nm. inner. HTML = "Jessie"; } window. onload = init; Your Name Here

        Create a function This function changes the value of an existing HTML element function Create a function This function changes the value of an existing HTML element function show_prompt() Function name { var name=prompt("Please enter your name", "Jane Doe"); if (name!=null && name!="") greet refers to element with id="greetings" { var greet = document. get. Element. By. Id("greetings"); greet. inner. HTML = "Hello, " + name ; } } inner. HTML changes the contents of the element with id="greetings"

        Try It Prompt the user for their hometown and then display the result on Try It Prompt the user for their hometown and then display the result on the webpage.

        Potential Solution <script> function init() { var tn = document. get. Element. By. Id( Potential Solution Your Hometown Here

        Respond to a button click <head> <script> function show_prompt() { var name=prompt( Respond to a button click

        Looping <html> <head> <script> function countdown() { var newtext = 0; i--) { newtext = newtext + " " + i; } blast. inner. HTML = newtext; } window. onload = countdown; // no parentheses

        Arrays var temp. By. Hour = new Array(); temp. By. Hour[0] = 59. 2; Arrays var temp. By. Hour = new Array(); temp. By. Hour[0] = 59. 2; temp. By. Hour[1] = 60. 1; temp. By. Hour[2] = 63; temp. By. Hour[3] = 65; temp. By. Hour[4] = 62; var temps = [59. 2, 60. 1, 63, 65, 62]; index 0

        Arrays // Add to existing array temp. By. Hour[5] = 61; // Get the Arrays // Add to existing array temp. By. Hour[5] = 61; // Get the value of one element of the array var message = "The temp at 5 pm was " + temp. By. Hour[5]; // Retrieve the size of the array var num. Items = temp. By. Hour. length; p. 67

        Creating an object with properties. . . iterating through the properties <html> <head> <script> Creating an object with properties. . . iterating through the properties

        empty
        is filled with: Animal Properties cow mammal 300

        Webville Tunes - Chapter 3 Ask user to enter songs and then add them Webville Tunes - Chapter 3 Ask user to enter songs and then add them to a songlist

        Webville Tunes " src="https://present5.com/presentation/0ab2cf26040de76b9aa97215eeb2c70c/image-92.jpg" alt="Webville Tunes - Chapter 3 Webville Tunes " /> Webville Tunes - Chapter 3 Webville Tunes

          /* playlist. js */ window. onload = init; function init() { var button = document. get. Element. By. Id("add. Button"); button. onclick = handle. Button. Click; } function handle. Button. Click(e) { var text. Input = document. get. Element. By. Id("song. Text. Input"); var song. Name = text. Input. value; alert("Adding " + song. Name); if (song. Name == "") { alert("Please enter a song"); } else { alert("Adding " + song. Name); var li = document. create. Element("li"); li. inner. HTML = song. Name; var ul = document. get. Element. By. Id("playlist"); ul. append. Child(li); } }

          Lab 3 l l Copy the folder lab 3 to your computer Assignment: Add Lab 3 l l Copy the folder lab 3 to your computer Assignment: Add a line to the bottom of the web page which displays the total number of songs entered into the play list Hints: 1. Edit lab 3 -playlist. htm and add an with an id="num. Songs" that will eventually hold the number of songs. Give it temporary text that says THIS WILL HOLD NUMBER OF SONGS IN PLAYLIST 2. Test to make sure your displays. . . continued on next slide. . .

          Lab 3 (cont. ) 3. 4. 5. 6. 7. 8. Edit lab 3 -playlist. Lab 3 (cont. ) 3. 4. 5. 6. 7. 8. Edit lab 3 -playlist. js Create a global variable called total_songs and set its initial value to 0 Find the part of the code that gets executed when a song is successfully entered. Inside that block of code, immediately after the new

        • gets appended into the
            , add code which. . . Adds one to the total_songs variable Creates a variable called s. Total to hold the element identified by id="num. Songs" Change the inner. HTML value of s. Total to "Total songs: " + total_songs. to. String() (note: solution can be found in the folder lab 3 -solution)

      Solution - Lab 3 lab 3 -playlist. html <form> <input type= Solution - Lab 3 lab 3 -playlist. html

      Total Number of Songs in Playlist will be displayed here

      Solution - Lab 3 lab 3 -playlist. js var total_songs = 0; . . Solution - Lab 3 lab 3 -playlist. js var total_songs = 0; . . . function handle. Button. Click() { var text. Input = document. get. Element. By. Id("song. Text. Input"); var song. Name = text. Input. value; if (song. Name == "") { alert("Please enter a song"); } else { alert("Adding " + song. Name); var li = document. create. Element("li"); // create new object li li. inner. HTML = song. Name; // give it text of user entered song. Name var ul = document. get. Element. By. Id("playlist"); // create new object attached to id=playlist ul. append. Child(li); // append the li object to end of ul id=playlist // Solution Additions/////////////////// total_songs=total_songs+1; var s. Total = document. get. Element. By. Id("num. Songs"); s. Total. inner. HTML = "Total songs: " + total_songs. to. String(); }

      Supplemental Lab 4 l Copy the folder called lab 4 to your computer l Supplemental Lab 4 l Copy the folder called lab 4 to your computer l Add another input text box and button which creates a list of Musicians. Make it work just like the Song list. Hints: l Edit lab 4 -playlist. htm and copy the form used for songs. Change the data to reflect musicians. l Edit lab 4 -playlist. js and add code to allow users to also enter a list of musicians (note: solution can be found in the folder lab 4 -solution)

      Solution - Lab 4 lab 4 -playlist-solution. html <form> <input type= Solution - Lab 4 lab 4 -playlist-solution. html

      Solution - Lab 4 lab 4 -playlist-solution. js function init() {. . . var Solution - Lab 4 lab 4 -playlist-solution. js function init() {. . . var mbutton = document. get. Element. By. Id("add. Musician. Button"); mbutton. onclick = handle. Musician. Click; } function handle. Musician. Click() { var text. Input = document. get. Element. By. Id("musician. Text. Input"); var musician = text. Input. value; if (musician == "") { alert("Please enter a musician name"); } else { alert("Adding " + musician); var li = document. create. Element("li"); li. inner. HTML = musician; var ul = document. get. Element. By. Id("musicianlist"); ul. append. Child(li); } }