Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML 5 (Part 1) – Start from SCRATCH. HTML 5 – Start from SCRATCH.

Similar presentations


Presentation on theme: "HTML 5 (Part 1) – Start from SCRATCH. HTML 5 – Start from SCRATCH."— Presentation transcript:

1 HTML 5 (Part 1) – Start from SCRATCH

2 HTML 5 – Start from SCRATCH

3 Start from SCRATCH † HTML 5 is cover all the facility and features of HTML. † So why does this HTML 5? There are some things which doesn’t support in HTML. † So we will know now what is the advance facility and coding in HTML 5. † Till now I have read so many posts on HTML 5 uses, more facility and many more things. † But from each article I get just brief overview. † So, decided to learn it and spread the knowledge to others with deep knowledge. † Let us take a deep look and learn HTML 5.

4 What is HTML 5 ? † In 1999, there are HTML and HTML 4.01 were invented by W3C. † Recently, World Wide Web Consortium (W3C) & the Web Hypertext Application Technology Working Group (WHATWG) invented HTML 5. † Before 2006, WHATWG was working on web forms and application, while W3C was working on XHTML 2.0. † In 2006, they both W3C and WHATWG decided to create new version of HTML, which have combine feature of WHATEG and W3C. † So then HTML 5 is come into existence.

5 Rules to invent HTML 5 † HTML 5 is the combination of HTML, CSS, DOM(Document Object Model) and JavaScript. † No need of plugin for.mp4 or.swf files. † Mostly scripts replaced by markup language. † It is device independent same like HTML. † The most desirable feature is that the development is visible to public also.

6 Basic webpage coding in HTML 5 † Let us see the basic HTML 5 web page. † Here you can see the declaration is contain only and the basic required tags of HTML 5.

7 Basic webpage coding in HTML 5

8 New and Interesting Features of HTML 5 1. You can draw 2D element with tag. 2. For media playback, you can use two tags and. 3. Some content specific elements are used i. e.,, and. 4. Good form control tags are date, time, email, url, calendar and search.

9 Some tags are removed from HTML 5 † Some elements came in HTML 4.01 are removed in HTML 5 and these are : a) b) c) d) e) f) g) h) i) j) k) l)

10 The element †It is used to draw graphics on the fly or on the webpage via scripting. †The element is only the container to store the graphics, but you have to use the script to actually draw the graphics. †Canvas has different methods for drawing different shapes like paths, boxes, circles, characters, and adding images. †Note : The browser IE 8 and earlier version do not support element.

11 The element †It is the rectangular area on the HTML page and specified with element. †By default, it has no border and no content. †How to write canvas code ? †Do not forget to specify id attribute because later it is use to refer into the script. (You may have more than one canvas element on one webpage, so id is become mandatory.) †Define width and height to specify the area of canvas.

12 The element †Use style attribute to add the border to the canvas.

13 The element †Let us see full example :

14 The element †The output look like below :

15 How to draw on element †The next two lines draw a pink rectangle with width 100 and height 150. †The fillStyle property can be a CSS color, a gradient, or a pattern. The default fillStyle is #000000 (black). †The fillRect(x,y,width,height) method draws a rectangle filled with the current fill style.

16 How to draw on element †Now let us understand this JavaScript step by step. †The first line after tag, this line finds the element. †Then the next line, call getContext() method. You must pass the “2D” string to the getCotext() method. †getContext(“2D”) is the built in HTML 5 object.

17 How to draw on element †Now let us understand this JavaScript step by step. †The first line after tag, this line finds the element. †Then the next line, call getContext() method. You must pass the “2D” string to the getCotext() method. †getContext(“2D”) is the built in HTML 5 object.

18 How to draw on element †Lets see the full example.

19 How to draw on element †Here is the output.

20 Coordinates of element †The canvas is a two-dimensional grid. †The upper-left corner of the canvas has coordinate (0,0). So, the fillRect() method above had the parameters (0,0,100,150). †This means : Start at the upper-left corner (0,0) and draw a 100x150 pixels rectangle. †Mouse over the rectangle below to see its x and y coordinates:

21 HTML 5 (Part 1) – Start from SCRATCH †Here we see how to make and how to draw basic rectangle shape on the canvas. †In the next presentation I will show you how to draw path, circle and write text on the canvas. †To be continued…


Download ppt "HTML 5 (Part 1) – Start from SCRATCH. HTML 5 – Start from SCRATCH."

Similar presentations


Ads by Google