HTML for JavaScript Web Applications

Slides:



Advertisements
Similar presentations
XHTML Week Two Web Design. 2 What is XHTML? XHTML is the current standard for HTML Newest generation of HTML (post-HTML 4) but has many new features which.
Advertisements

Using CSS for Page Layout. Types of HTML Elements Block-Level Element –Creates blocks of content e.g. div, h1..h6, p, ul, ol, li, table, form –They start.
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
© Ms. Masihi 1.  A web page is created using a language called, Hypertext Markup Language, better known as HTML Code.  HTML is a user friendly language.
Programming I 2 nd lecture. Block-level and inline elements BlockInline block-level elements generally can contain text, data, inline elements, or other.
Learning HTML. HTML Attributes HTML elements can have attributes Attributes provide additional information about an element Class – specifies a class.
>> Introduction to HTML: Tables. HTML is used to give websites structure 5 Basic Tags Element = Start-Tag+Content+End-Tag Heading Tags [h1-h6] Paragraph.
Lesson 02 // Elements & Attributes. There are different types of elements, but the 2 most important ones are BLOCK and INLINE. Block elements flow from.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
HTML.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
Week 2: Building a Simple Website IMC 320 Web Publishing Spring 2011.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
University of South Asia Course Name: Web Application Prepared By: Md Rezaul Huda Reza
HTML and CSS HTML is used for the content of web pages CSS is used for the style of the web pages You are going to learn how they can be combined to create.
Cascading Style Sheets (CSS) EXPLORING COMPUTER SCIENCE – LESSON 3-5.
Elements & Attributes. There are different types of elements, but the 2 most important ones are BLOCK and INLINE. Block elements flow from top to bottom.
HTML LAYOUTS. CONTENTS Layouts Example Layout Using Element Example Using Table Example Output Summary Exercise.
INTRODUCTION ABOUT DIV Most websites have put their content in multiple columns. Multiple columns are created by using or elements. The div element is.
HTML Basics Text, Images, Tables, Forms. HTML Structure HTML is comprised of “elements” and “tags” – Begins with and ends with Elements (tags) are nested.
Week 1: Introduction to HTML and Web Design
HTML Extra Markup CS 1150 Spring 2017.
Cascading Style Sheets for layout
Cascading Style Sheets (CSS)
HTML.
INTRO TO WEB DEVELOPMENT html
Web Systems & Technologies
Web Basics: HTML/CSS/JavaScript What are they?
CGS 3066: Lecture 2 Web Development and HTML5
Organizing Content with Lists and Tables
Semester - Review.
CSS Layouts: Grouping Elements
Elements of HTML Web Design – Sec 3-2
>> Introduction to CSS
HTML: HyperText Markup Language
Elements of HTML Web Design – Sec 3-2
Positioning Objects with CSS and Tables
Intro to JavaScript CS 1150 Spring 2017.
© 2016, Mike Murach & Associates, Inc.
Display Property.
Cascading Style Sheets (CSS)
Cascading Style Sheets for layout
Lists, Thumbnails, and Icons
CS543: WEB APPLICATION PROGRAMMING
AN INTRODUCTORY LESSON TO MAKING A SIMPLE WEB PAGE By: RC Emily Solis
Elements of HTML Web Design – Sec 3-2
<start>middle</end> Version 1.1
HTML Images CS 1150 Spring 2017.
ITI 133 HTML5 Desktop and Mobile Level I
PAGE LAYOUT - 1.  Most HTML elements are defined as block level elements or inline elements.  Block level elements normally start (and end) with a new.
HTML5 Level I Session II Chapter 3 - How to Use HTML to Structure a Web Page
Fixed Positioning.
Web Programming A different world! Three main languages/tools No Java
CGS 3066: Lecture 2 Web Development and HTML5
HTML ELEMENTS Ms. Olifer.
Cascading Style Sheets
Secure Web Programming
Some Stuff You Need to Know
HTML Images CS 1150 Fall 2016.
Exercise 9 Skills You create and use styles to create formatting rules that can easily by applied to other pages in the Web site. You can create internal.
Computer communications
HTML and CSS Basics.
Lesson 2: HTML5 Coding.
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
Positioning Objects with CSS and Tables
Web Programming and Design
© 2017, Mike Murach & Associates, Inc.
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
Presentation transcript:

HTML for JavaScript Web Applications CS3550 Dr. Brian Durney

Example web app This presentation refers to the game Rigel Station: Security Alert as a sample web application. You can find the game at: http://universe.tc.uvu.edu/Game/RSSA/index.html

Kinds of HTML elements Block Inline List items div, p, h1, ul, ol span, a, b List items li

div elements Block elements Often used to organize a web page Can contain other block elements: paragraphs, headings, lists, and nested divs Can be used to easily apply formatting to multiple elements

<div id="mapDiv"> <img id="mapImg" src="sectorMap450.png"> <br> <div style="font-size: 140%"> Security rating: <span id="scoreSpan"> 0 </span> <br> Time: <span id="timeSpan"> 0:00 </span> </div> A div element is used to hold the map image and the two lines of text beneath it.

A nested div holds two lines of text. <div id="mapDiv"> <img id="mapImg" src="sectorMap450.png"> <br> <div style="font-size: 140%"> Security rating: <span id="scoreSpan"> 0 </span> <br> Time: <span id="timeSpan"> 0:00 </span> </div> A nested div holds two lines of text.

Another div contains the message area and the sector buttons. <div id="controlDiv"> <div id=“msgDiv"> Scanning for security reports... </div> <div> <span style="..."> SECTOR I </span> ... Another div contains the message area and the sector buttons.

Two other divs are nested inside the right-hand side div. <div id="controlDiv"> <div id=“msgDiv"> Scanning for security reports... </div> <div> <span style="..."> SECTOR I </span> ... Two other divs are nested inside the right-hand side div.

Page organization Using a table instead of divs would make it much more difficult to achieve the desired layout. Tables are less flexible than divs and should only be used when a grid layout is appropriate.

span elements Inline elements Used to apply a style to part of a text element Also used to make part of an HTML text element accessible to JavaScript

These two span elements are used to display the score and the time. <div id="mapDiv"> <img id="mapImg" src="sectorMap450.png"> <br> <div style="font-size: 140%"> Security rating: <span id="scoreSpan"> 0 </span> <br> Time: <span id="timeSpan"> 0:00 </span> </div> These two span elements are used to display the score and the time.

<div id="mapDiv"> <img id="mapImg" src="sectorMap450.png"> <br> <div style="font-size: 140%"> Security rating: <span id="scoreSpan"> 0 </span> <br> Time: <span id="timeSpan"> 0:00 </span> </div> When the game starts, the score (“security rating”) is 0 and the time is 0:00.

<div id="mapDiv"> <img id="mapImg" src="sectorMap450.png"> <br> <div style="font-size: 140%"> Security rating: <span id="scoreSpan"> 0 </span> <br> Time: <span id="timeSpan"> 0:00 </span> </div> As the game progresses, JavaScript code updates the values of the score and the time.

id attributes Used to identify elements for use in HTML forms, CSS (styles), and JavaScript

Note the id attributes in the spans for the score and the time. <div id="mapDiv"> <img id="mapImg" src="sectorMap450.png"> <br> <div style="font-size: 140%"> Security rating: <span id="scoreSpan"> 0 </span> <br> Time: <span id="timeSpan"> 0:00 </span> </div> Note the id attributes in the spans for the score and the time.

<div id="mapDiv"> <img id="mapImg" src="sectorMap450.png"> <br> <div style="font-size: 140%"> Security rating: <span id="scoreSpan"> 0 </span> <br> Time: <span id="timeSpan"> 0:00 </span> </div> These id attributes allow JavaScript code to easily access these span elements.

Summary Divs are block elements used to organize a page and allow easy formatting of multiple elements. Spans are inline elements. Adding id attributes makes it easier to access divs, spans, and other HTML elements from JavaScript.