Syllabus - July to Sept

Similar documents
Web Programming HTML CSS JavaScript Step by step Exercises Hans-Petter Halvorsen

What is CSS? NAME: INSERT OPENING GRAPHIC HERE:

CSS how to display to solve a problem External Style Sheets CSS files

Hyper Text Markup Language HTML: A Tutorial

Web Designing HTML5 NOTES

HTML Text Formatting. HTML Session 2 2

WEBSITE DESIGNING. Web designing has direct link to visual aspect of a web site. Effective web design is necessary to communicate ideas effectively.

Assignments (4) Assessment as per Schedule (2)

HTMLnotesS15.notebook. January 25, 2015

Using Dreamweaver CS6

Cascading style sheets, HTML, DOM and Javascript

Tizen Web UI Technologies (Tizen Ver. 2.3)

Html basics Course Outline

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

CGS 3066: Spring 2015 JavaScript Reference

HTML Hyperlinks (Links)

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

Basic CSS Lecture 17

Programmazione Web a.a. 2017/2018 HTML5

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

Using Dreamweaver CS6

Introduction to Web Technologies

BIM222 Internet Programming

CITS1231 Web Technologies. JavaScript

Using Dreamweaver. 6 Styles in Websites. 1. Linked or Imported Stylesheets. 2. Embedded Styles. 3. Inline Styles

Markup Language SGML: Standard Generalized Markup Language. HyperText Markup Language (HTML) extensible Markup Language (XML) TeX LaTeX

Introduction to HTML. SSE 3200 Web-based Services. Michigan Technological University Nilufer Onder

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

Lesson 5 Introduction to Cascading Style Sheets

Client Side Concepts Quiz Solution

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

CSS. M hiwa ahamad aziz Raparin univercity. 1 Web Design: Lecturer ( m hiwa ahmad aziz)

HTML Images - The <img> Tag and the Src Attribute

c122jan2714.notebook January 27, 2014

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em>

CST272 ASP.NET Style Sheets Page 1

HTML, CSS, JavaScript

Web Programming Week 2 Semester Byron Fisher 2018

INFORMATICA GENERALE 2014/2015 LINGUAGGI DI MARKUP CSS

Three Ways to Use CSS:

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

CSS.

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Introduction to using HTML to design webpages

Comp-206 : Introduction to Software Systems Lecture 23. Alexandre Denault Computer Science McGill University Fall 2006

FrontPage 2000 Tutorial -- Advanced

Module 2 (VI): CSS [Part 3]

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

Web Design and Development ACS-1809

Intermediate Web Publishing: Working with Styles

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

Purpose of this doc. Most minimal. Start building your own portfolio page!

Web Site Development with HTML/JavaScrip

NEW WEBMASTER HTML & CSS FOR BEGINNERS COURSE SYNOPSIS

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

Princess Nourah bint Abdulrahman University. Computer Sciences Department

INTRODUCTION TO WEB USING HTML What is HTML?

BASICS OF WEB DESIGN CHAPTER 2 HTML BASICS KEY CONCEPTS

E , Fall 2007 More with stylesheets

CSC 121 Computers and Scientific Thinking

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

Comm 244 Week 3. Navigation. Navigation. Websites need a formalized system of links to allow users to navigate the site

Introduction to HTML

CSS stands for Cascading Style Sheets Styles define how to display HTML elements

DAY 4. Coding External Style Sheets

Web Technologies - by G. Sreenivasulu Handout - 1 UNIT - I

MPT Web Design. Week 1: Introduction to HTML and Web Design

Title: Jan 29 11:03 AM (1 of 23) Note that I have now added color and some alignment to the middle and to the right on this example.

Cascading Style Sheets (CSS) Part 1 of 3: Introduction and overview

What is a web site? Web editors Introduction to HTML (Hyper Text Markup Language)

In the early days of the Web, designers just had the original 91 HTML tags to work with.

CSS: The Basics CISC 282 September 20, 2014

INTRODUCTION TO HTML5! HTML5 Page Structure!

Page Layout Using Tables

CITS1231 Web Technologies. Introduction to Cascading Style Sheets

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 1

Chapter 7 Typography, Style Sheets, and Color. Mrs. Johnson

INTRODUCTION TO HTML5! CSS Styles!

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)

1. Cascading Style Sheet and JavaScript

HTML, beyond the basics

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

Introduction to JavaScript

Building Your Website

CSS: formatting webpages

CS 350 Internet Applications I Name: Exam II (CSS) October 29, 2013

Web Development and HTML. Shan-Hung Wu CS, NTHU

CSS Selectors. Web Authoring and Design. Benjamin Kenwright

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

Introduction to WEB PROGRAMMING

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

E ECMAScript, 21 elements collection, HTML, 30 31, 31. Index 161

A Balanced Introduction to Computer Science, 3/E

It is possible to create webpages without knowing anything about the HTML source behind the page.

Navigation. Websites need a formalized system of links to allow users to navigate the site

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective-

LING 408/508: Computational Techniques for Linguists. Lecture 14

Transcription:

Class IX Sub: Computer Syllabus - July to Sept What is www: The World Wide Web (www, W3) is an information space where documents and other web resources are identified by URIs, interlinked by hypertext links, and can be accessed via the Internet. It has become known simply as the Web. Header The <header> element represents a container for introductory content or a set of navigational links. A <header> element typically contains: one or more heading elements (<h1> - <h6>) logo or icon You can have several <header> elements in one document.

HTML Headings Headings are defined with the <h1> to <h6> tags. <h1> defines the most important heading. <h6> defines the least important heading. Example <h1>heading 1</h1> <h2>heading 2</h2> <h3>heading 3</h3> <h4>heading 4</h4> <h5>heading 5</h5> <h6>heading 6</h6> Result of Above Example Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 HTML Tag The tag defines the document's body. The element contains all the contents of an HTML document, such as text, hyperlinks, images, tables, lists, etc The HTML <title> Element The <title> tag defines the title of the document. A simplified HTML document:

<head> <title>title of the document</title> </head> The content of the document... HTML Paragraphs The HTML <p> element defines a paragraph Example : <p>this is a paragraph.</p> <p>this is a paragraph.</p> <p>this is a paragraph.</p> Result of Above Program: This is a paragraph. This is a paragraph. This is a paragraph. HTML Tables Tables are defined with the <table> tag. A table is divided into rows with the <tr> tag. (tr stands for table row) A row is divided into data cells with the <td> tag. (td stands for table data) A row can also be divided into headings with the <th> tag. (th stands for table heading)

<head> Sample Table </head> <table border="1"> <tr> <th>state</th> <th>capital</th> </tr> <tr> <td>maharashtra</td> <td>mumbai</td> </tr> <tr> <td>gujrat</td> <td>gandhinagar</td> </tr> </table> Result of Above Program Sample Table State Maharashtra Gujrat Mumbai Capital Gandhinagar HTML Lists The most common HTML lists are ordered and unordered lists: HTML Lists An ordered list: 1. The first list item 2. The second list item 3. The third list item An unordered list: List item List item List item HTML Unordered Lists An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. The list items are marked with bullets (typically small black circles).

<ul> <li>coffee</li> <li>milk</li> </ul> How the HTML code above looks in a browser: Coffee Milk HTML Ordered Lists An ordered list starts with the <ol> tag. Each list item starts with the <li> tag. The list items are marked with numbers. <ol> <li>coffee</li> <li>milk</li> </ol> How the HTML code above looks in a browser: 1. Coffee 2. Milk Styling HTML Elements CSS (Cascading Style Sheets) was introduced in December 1996 by the W3C, to provide a better way to style HTML elements. With CSS, it becomes easy to specify the colors used for the text and the backgrounds, the size and the style for the fonts, the amount of space between elements, adding border and outlines to the elements and a host of other styling. Adding Styles to HTML Elements Style information can be either attached as a separate document or embedded in the HTML document. These are the three methods of implementing styling information to the HTML document (from highest to lowest priority). Inline styles Using the style attribute in the HTML start tag. Embedded style Using the <style> element in the head section of the document. External style sheet Using the <link> element, pointing to an external CSS files.

Inline Styles Inline styles are used to apply the unique style rules to an element by putting the CSS rules directly into the start tag. It can be attached to an element using the style attribute. The style attribute includes a series of CSS property and value pairs. Each property: value pair is separated by a semicolon (;), just as you would write into an embedded or external style sheet. But it needs to be all in one line i.e. no line break after the semicolon. The following example will show you how to change the color and fontsize of the text: <head> <title>example of HTML Inline Styles</title> </head> <h1 style="color:red;font-size:30px;"> This is a heading </h1> <p style="color:green;font-size:18px;"> This is a paragraph. </p> <hr style="border-color:blue;"> Output of Above Program: This is a heading This is a paragraph. Embedded Style Sheets Embedded or internal style sheets only affect the document they are embedded in. Embedded style sheets are defined in the <head> section of an HTML document using the <style> tag. You can define any number of <style> elements inside the <head> section of an HTML document. See the example below:

<head> <title>example of HTML Embedded Style Sheet</title> <style type="text/css"> body { background-color: YellowGreen; h1 { color: red; p { color: green; </style> </head> <h1>this is a heading</h1> <p>this is a paragraph.</p> External Style Sheets An external style sheet is ideal when the style is applied to many pages. An external style sheet holds all the style rules in a separate document that you can link from any HTML file on your site. External style sheets are the most flexible because with an external style sheet, you can change the look of an entire website by changing just one file. You can attach external style sheets in two ways linking and importing: Linking External Style Sheets An external style sheet can be linked to an HTML document using the <link> tag. The <link> tag goes inside the <head> section: <head> <title>example of HTML External Style Sheet</title> <link rel="stylesheet" type="text/css" href="/examples/css/style.css"> </head> <h1>linking External Style Sheet</h1> <p>the styles of this HTML document are defined in linked style sheet.</p>

Output of Above Program: Linking External Style Sheet The styles of this HTML document are defined in linked style sheet. Styling HTML with CSS CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen, paper, or in other media. CSS saves a lot of work. It can control the layout of multiple web pages all at once. CSS can be added to HTML elements in 3 ways: Inline - by using the style attribute in HTML elements Internal - by using a <style> element in the <head> section External - by using an external CSS file The most common way to add CSS, is to keep the styles in separate CSS files. However, here we will use inline and internal styling, because this is easier to demonstrate, and easier for you to try it yourself. Inline CSS An inline CSS is used to apply a unique style to a single HTML element. An inline CSS uses the style attribute of an HTML element. This example sets the text color of the <h1> element to blue: <h1 style="color:blue;">this is a Blue Heading</h1>

OutPut: This is a Blue Heading Internal CSS An internal CSS is used to define a style for a single HTML page. An internal CSS is defined in the <head> section of an HTML page, within a <style> element: <head> <style> body {background-color: powderblue; h1 {color: blue; p {color: red; </style> </head> <h1>this is a heading</h1> <p>this is a paragraph.</p> OutPut External CSS: An external style sheet is used to define the style for many HTML pages.

With an external style sheet, you can change the look of an entire web site, by changing one file! To use an external style sheet, add a link to it in the <head> section of the HTML page: <head> <link rel="stylesheet" href="styles.css"> </head> <h1>this is a heading</h1> <p>this is a paragraph.</p> Output This is a heading This is a paragraph. An external style sheet can be written in any text editor. The file must not contain any HTML code, and must be saved with a.css extension. Here is how the "styles.css" looks: body { background-color: powderblue; h1 { color: blue; p { color: red; CSS Fonts The CSS color property defines the text color to be used. The CSS font-family property defines the font to be used. The CSS font-size property defines the text size to be used.

<head> <style> h1 { color: blue; font-family: verdana; font-size: 300%; p { color: red; font-family: courier; font-size: 160%; </style> </head> <h1>this is a heading</h1> <p>this is a paragraph.</p> CSS Border The CSS border property defines a border around an HTML element: Example p { border: 1px solid powderblue; CSS Margin The CSS margin property defines a margin (space) outside the border: Example p { border: 1px solid powderblue; margin: 50px;

The Id Attribute To define a specific style for one special element, add an id attribute to the element: <p id="p01">i am different</p> then define a style for the element with the specific id: Example #p01 { color: blue; The class Attribute To define a style for a special type of elements, add a class attribute to the element: <p class="error">i am different</p> then define a style for the elements with the specific class: Example p.error { color: red; Syllabus Oct-Dec JavaScript Introduction JavaScript is the most popular programming language in the world.

It is the language for HTML, for the Web, for computers, servers, laptops, tablets, smart phones, and more. Why Study JavaScript? JavaScript is one of 3 languages all web developers MUST learn: 1. HTML to define the content of web pages 2. CSS to specify the layout of web pages 3. JavaScript to program the behavior of web pages. A brief history of JavaScript JavaScript was created by Brendan Eich in 1995 during his time at Netscape Communications. Where JavaScript is used JavaScript is used to create interactive websites. It is mainly used for: o o o o o Client-side validation Dynamic drop-down menus Displaying data and time Displaying popup windows and dialog boxes (like alert dialog box, confirm dialog box and prompt dialog box) Displaying clocks etc. JavaScript Syntax JavaScript can be implemented using JavaScript statements that are placed within the <script>.... You can place the <script> tags, containing your JavaScript, anywhere within your web page, but it is normally recommended that you should keep it within the <head> tags. Your First JavaScript Program <script language="javascript" type="text/javascript"> document.write("hello World!")

Output: Hello World Enabling JavaScript in Browsers JavaScript in Internet Explorer Here are simple steps to turn on or turn off JavaScript in your Internet Explorer Follow Tools Internet Options from the menu. Select Security tab from the dialog box. Click the Custom Level button. Scroll down till you find Scripting option. Select Enable radio button under Active scripting. Finally click OK and come out To disable JavaScript support in your Internet Explorer, you need to select Disable radio button under Active scripting. JavaScript - Variables Like many other programming languages, JavaScript has variables. Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container. Before you use a variable in a JavaScript program, you must declare it. Variables are declared with the var keyword as follows. <script type="text/javascript"> <!-- var money; var name; //--> You can also declare multiple variables with the same var keyword as follows <script type="text/javascript"> <!-- var money, name; //-->

Storing a value in a variable is called variable initialization. You can do variable initialization at the time of variable creation or at a later point in time when you need that variable. JavaScript Variable Scope The scope of a variable is the region of your program in which it is defined. JavaScript variables have only two scopes. Global Variables A global variable has global scope which means it can be defined anywhere in your JavaScript code. Local Variables A local variable will be visible only within a function where it is defined. Function parameters are always local to that function. What is an operator? Let us take a simple expression 4 + 5 is equal to 9. Here 4 and 5 are called operands and + is called the operator. JavaScript supports the following types of operators. Types of Operators 1. Logical Operators 2. Arithmetic Operators 3. Relational Operators JavaScript Logical Operators Operator Description && logical and logical or! logical not JavaScript Arithmetic Operators Arithmetic operators are used to perform arithmetic on numbers: Operator Description + Addition - Subtraction * Multiplication / Division % Modulus (Remainder) ++ Increment -- Decrement

JavaScript Comparison Operators Operator Description == equal to === equal value and equal type!= not equal!== not equal value or not equal type > greater than < less than >= greater than or equal to <= less than or equal to? ternary operator JavaScript - if...else Statement While writing a program, there may be a situation when you need to adopt one out of a given set of paths. In such cases, you need to use conditional statements that allow your program to make correct decisions and perform right actions. if statement The if statement is the fundamental control statement that allows JavaScript to make decisions and execute statements conditionally. Syntax The syntax for a basic if statement is as follows if (expression){ Statement(s) to be executed if expression is true Example Try the following example to understand how the if statement works. <script type="text/javascript"> <!-- var age = 20; if( age > 18 ){ document.write("<b>qualifies for driving</b>"); //--> <p>set the variable to different value and then try...</p>

Output Qualifies for driving Set the variable to different value and then try... if...else statement: The 'if...else' statement is the next form of control statement that allows JavaScript to execute statements in a more controlled way. Syntax if (expression){ Statement(s) to be executed if expression is true else{ Statement(s) to be executed if expression is false Here JavaScript expression is evaluated. If the resulting value is true, the given statement(s) in the if block, are executed. If the expression is false, then the given statement(s) in the else block are executed. Example Try the following code to learn how to implement an if-else statement in JavaScript. <script type="text/javascript"> <!-- var age = 15; if( age > 18 ){ document.write("<b>qualifies for driving</b>"); else{ document.write("<b>does not qualify for driving</b>"); //--> <p>set the variable to different value and then try...</p> Output Does not qualify for driving Set the variable to different value and then try...

JavaScript - Switch Case Syntax The objective of a switch statement is to give an expression to evaluate and several different statements to execute based on the value of the expression. The interpreter checks each case against the value of the expression until a match is found. If nothing matches, a default condition will be used. switch (expression) { case condition 1: statement(s) break; case condition 2: statement(s) break;... case condition n: statement(s) break; default: statement(s) The break statements indicate the end of a particular case. If they were omitted, the interpreter would continue executing each statement in each of the following cases. We will explain break statement in Loop Control chapter. Example Try the following example to implement switch-case statement. <script type="text/javascript"> <!-- var grade='a'; document.write("entering switch block<br />"); switch (grade) { case 'A': document.write("good job<br />"); break; case 'B': document.write("pretty good<br />"); break; case 'C': document.write("passed<br />"); break; case 'D': document.write("not so good<br />");

break; case 'F': document.write("failed<br />"); break; default: document.write("unknown grade<br />") document.write("exiting switch block"); //--> <p>set the variable to different value and then try...</p> Output Entering switch block Good job Exiting switch block Set the variable to different value and then try... Break statements play a major role in switch-case statements. Try the following code that uses switch-case statement without any break statement. <script type="text/javascript"> <!-- var grade='a'; document.write("entering switch block<br />"); switch (grade) { case 'A': document.write("good job<br />"); case 'B': document.write("pretty good<br />"); case 'C': document.write("passed<br />"); case 'D': document.write("not so good<br />"); case 'F': document.write("failed<br />"); default: document.write("unknown grade<br />") document.write("exiting switch block"); //--> <p>set the variable to different value and then try...</p> Output Entering switch block Good job Pretty good Passed Not so good Failed Unknown grade Exiting switch block

Set the variable to different value and then try... JavaScript For Loop Loops can execute a block of code a number of times. JavaScript Loops Loops are handy, if you want to run the same code over and over again, each time with a different value. Often this is the case when working with arrays: Instead of writing: text += cars[0] + "<br>"; text += cars[1] + "<br>"; text += cars[2] + "<br>"; text += cars[3] + "<br>"; text += cars[4] + "<br>"; text += cars[5] + "<br>"; You can write: <h2>javascript Loops</h2> <p id="demo"></p> <script> var cars = ["BMW", "Volvo", "Saab", "Ford", "Fiat", "Audi"]; var text = ""; var i; for (i = 0; i < cars.length; i++) { text += cars[i] + "<br>"; document.getelementbyid("demo").innerhtml = text; Different Kinds of Loops JavaScript supports different kinds of loops: for - loops through a block of code a number of times

for/in - loops through the properties of an object while - loops through a block of code while a specified condition is true do/while - also loops through a block of code while a specified condition is true Window Object Methods & POP UP Boxes Some object Methods with examples are as follows: Method alert() confirm() open() print() Description Displays an alert box with a message and an OK button Displays a dialog box with a message and an OK and a Cancel button Opens a new browser window Prints the content of the current window Example of alert() <p>click the button to display an alert box.</p> <button onclick="myfunction()">try it</button> <script> function myfunction() { alert("hello! I am an alert box!"); Example of Confirm() <p>click the button to display a confirm box.</p> <button onclick="myfunction()">try it</button> <script> function myfunction() { confirm("press a button!");

Example of open() <p>click the button to open a new browser window.</p> <button onclick="myfunction()">try it</button> <script> function myfunction() { window.open("https://www.w3schools.com"); Example of print() <p>click the button to print the current page.</p> <button onclick="myfunction()">print this page</button> <script> function myfunction() { window.print();