Presentation is loading. Please wait.

Presentation is loading. Please wait.

CHAPTER 2 HTML & HTML5 II อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.

Similar presentations


Presentation on theme: "CHAPTER 2 HTML & HTML5 II อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1."— Presentation transcript:

1 CHAPTER 2 HTML & HTML5 II อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1

2 Content HTML Forms HTML Form Elements HTML Input Types HTML5 Input Types HTML Input Attributes HTML5 Attributes HTML5 Introduction 2

3 Content HTML5 Semantic Elements HTML5 Migration HTML5 Canvas HTML5 SVG HTML5 Video HTML5 Audio 3

4 HTML Forms The Element HTML forms are used to collect user input.. form elements. 4 The Element The element is the most important form element. TypeDescription textDefines normal text input radioDefines radio button input (for selecting one of many choices) submitDefines a submit button (for submitting the form)

5 HTML Forms (cont.) Text Input First name: Last name: 5

6 HTML Forms (cont.) Radio Button Input Male Female 6

7 HTML Forms (cont.) The Submit Button First name: Last name: 7

8 HTML Forms (cont.) The Action Attribute The action attribute defines the action to be performed when the form is submitted. 8 The Method Attribute The method attribute specifies the HTTP method (GET or POST) to be used when submitting the forms: or

9 HTML Form Elements The Element The most important form element is the element. The element can vary in many ways, depending on the type attribute. 9 The Element (Drop-Down List) The element defines a drop-down list: Volvo Saab Fiat Audi

10 HTML Form Elements The Element The cat was playing in the garden. 10 The Element Click Me!

11 HTML Form Elements HTML5 Element 11

12 HTML Form Elements HTML5 Element Username: Encryption: 12

13 HTML Form Elements HTML5 Element 0 100 + = 13

14 HTML Input Types Input Type: text First name: Last name: 14 Input Type: password User name: User password:

15 HTML Input Types (cont.) Input Type: submit First name: 15 Input Type: radio Male Female

16 HTML Input Types (cont.) Input Type: checkbox I have a bike I have a car 16 Input Type: button

17 HTML5 Input Types HTML5 added several new input types: – color – date – datetime – datetime-local – email – month – number – range – search – tel – time – url – week *Input types, not supported by old web browsers, will behave as input type text. 17

18 HTML5 Input Types (cont.) Input Type: date Birthday: 18 Input Type: color Select your favorite color:

19 HTML5 Input Types (cont.) Input Type: range 19 Input Type: email E-mail:

20 HTML Input Attributes The value Attribute First name: Last name: 20 The readonly Attribute First name: Last name:

21 HTML Input Attributes (cont.) The disabled Attribute First name: Last name: 21 The size Attribute First name: Last name:

22 HTML5 Attributes HTML5 added the following attributes for : – autocomplete – autofocus – form – formaction – formenctype – formmethod – formnovalidate – formtarget – height and width – list 22 – min and max – multiple – pattern (regexp) – placeholder – required – step and the following attributes for : – autocomplete – novalidate

23 HTML5 Introduction What is New in HTML5? The DOCTYPE declaration for HTML5 is very simple: The character encoding (charset) declaration is also very simple: HTML5 Example: Title of the document Content of the document...... 23

24 HTML5 Introduction (cont.) New HTML5 Elements The most interesting new elements are: New semantic elements like,,, and. New form control attributes like number, date, time, calendar, and range. New graphic elements: and. New multimedia elements: and. 24

25 HTML5 Semantic Elements What are Semantic Elements? A semantic element clearly describes its meaning to both the browser and the developer. Examples of non-semantic elements: and - Tells nothing about its content. Examples of semantic elements:,, and - Clearly defines its content. 25 New Semantic Elements in HTML5

26 HTML5 Semantic Elements (cont.) HTML5 Element WWF The World Wide Fund for Nature (WWF) is.... 26 HTML5 Element What Does WWF Do? WWF's mission is to stop the degradation of our planet's natural environment, and build a future in which humans live in harmony with nature.

27 HTML5 Semantic Elements (cont.) HTML5 Element What Does WWF Do? WWF's mission: WWF's mission is to stop the degradation of our planet's natural environment, and build a future in which humans live in harmony with nature. 27 HTML5 Element Posted by: Hege Refsnes Contact information: someone@example.com.

28 HTML5 Semantic Elements (cont.) HTML5 Element HTML | CSS | JavaScript | jQuery 28 HTML5 Element My family and I visited The Epcot center this summer. Epcot Center The Epcot Center is a theme park in Disney World, Florida.

29 HTML5 Migration Migration from HTML4 to HTML5 29 Typical HTML4Typical HTML5

30 HTML5 Canvas The HTML element is used to draw graphics on a web page. The graphic to the left is created with. It shows four elements: a red rectangle, a gradient rectangle, a multicolor rectangle, and a multicolor text. 30 Basic Canvas Example Drawing with JavaScript var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.fillStyle = "#FF0000"; ctx.fillRect(0,0,150,75);

31 HTML5 Canvas (cont.) 31 Draw a Line var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.moveTo(0,0); ctx.lineTo(200,100); ctx.stroke(); Draw a Circle var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.beginPath(); ctx.arc(95,50,40,0,2*Math.PI); ctx.stroke();

32 HTML5 SVG 32 What is SVG? SVG stands for Scalable Vector Graphics SVG is used to define graphics for the Web SVG is a W3C recommendation SVG Circle

33 HTML5 SVG (cont.) 33 SVG Rectangle SVG Rounded Rectangle

34 HTML5 Video 34 The HTML Element Your browser does not support the video tag. HTML Autoplay Your browser does not support the video tag.

35 HTML5 Audio 35 The HTML Element Your browser does not support the audio element.

36 36 THE END


Download ppt "CHAPTER 2 HTML & HTML5 II อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1."

Similar presentations


Ads by Google