SlideShare a Scribd company logo
1 of 12
Download to read offline
HTML5 NEW ELEMENT
322432 Web Design Technology
Syntax HTML5
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
HTML5 New Elements
TAG Description
Canvas ใช้ในการวาดกราฟิก
Example
<canvas id="myCanvas" width="200"
height="100" style="border:1px solid
#000000;">
Your browser does not support the HTML5
canvas tag.
</canvas>
New media element
Tag Description
<audio> สาหรับเล่นไฟล์เสียง
<video> สาหรับเล่นไฟล์วิดีโอ
<source> มีเดียไฟล์
<embed> การเพิ่มปลั๊กอิน
<track> อธิบายแท๊กสาหรับไฟล์วิดีโอและไฟล์เสียง
ตัวอย่าง
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4”>
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
New Form Element
Tag Description
<datalist> Specifies a list of pre-
defined options for input
controls
<keygen> Defines a key-pair
generator field (for forms)
< output> Defines the result of a
calculation
Canvas
Draw Onto The Canvas With JavaScript
Example
<script>
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.fillStyle="#FF0000";
ctx.fillRect(0,0,150,75);
</script>
First, find the <canvas> element:
The fillRect(x,y,width,height)
X
Y
Example Canvas
//Circle
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.arc(95,50,40,0,2*Math.PI);
ctx.stroke();
//Text
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.font="30px Arial";
ctx.fillText("Hello World",10,50);
Canvas – Gradients
Example
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
// Create gradient
var grd=ctx.createLinearGradient(0,0,200,0);
grd.addColorStop(0,"red");
grd.addColorStop(1,"white");
// Fill with gradient
ctx.fillStyle=grd;
ctx.fillRect(10,10,150,80);
Canvas - Images
Example
<p>Image to use:</p>
<img id="scream" src="img_the_scream.jpg" alt="The Scream"
width="220" height="277"><p>Canvas:</p>
<canvas id="myCanvas" width="250" height="300"
style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var img=document.getElementById("scream");
ctx.drawImage(img,10,10);
LAB#4 New Element HTML5
ให้นักศึกษาสร้างเว็บเพจ HTML5 โดยให้มี Canvas และมีการแทรกวิดีโอไฟล์แบบ
HTML5 นาเสนอให้สวยงาม
คะแนนเต็ม 10 คะแนน
ตามความยากง่ายของงานและความสวยงาม
========= ส่งในชั่วโมง ========================
Reference
http://www.w3schools.com/html/default.asp
http://www.808.dk/?code-html-5-video
http://www.bigbuckbunny.org/index.php/download/

More Related Content

Viewers also liked

Phptraining
PhptrainingPhptraining
Phptrainingphochai
 
การเขียนเว็บเพจด้วยภาษา HTML
การเขียนเว็บเพจด้วยภาษา HTMLการเขียนเว็บเพจด้วยภาษา HTML
การเขียนเว็บเพจด้วยภาษา HTMLMjjeje Mint
 
สมัคร และการใช้งาน Google drive
สมัคร และการใช้งาน Google driveสมัคร และการใช้งาน Google drive
สมัคร และการใช้งาน Google drivePakornkrits
 
ความรู้เบื้องต้นเกี่ยวกับสื่อสิ่งพิมพ์
ความรู้เบื้องต้นเกี่ยวกับสื่อสิ่งพิมพ์ความรู้เบื้องต้นเกี่ยวกับสื่อสิ่งพิมพ์
ความรู้เบื้องต้นเกี่ยวกับสื่อสิ่งพิมพ์Mjjeje Mint
 
การประดับแพรแถบย่อของเครื่องราชอิสริยาภรณ์
การประดับแพรแถบย่อของเครื่องราชอิสริยาภรณ์การประดับแพรแถบย่อของเครื่องราชอิสริยาภรณ์
การประดับแพรแถบย่อของเครื่องราชอิสริยาภรณ์Pakornkrits
 
การใช งานโปรแกรม Dreamweaver cs6
การใช งานโปรแกรม Dreamweaver cs6การใช งานโปรแกรม Dreamweaver cs6
การใช งานโปรแกรม Dreamweaver cs6Sara Zara
 
วิชาการผลิตมัลติมีเดีย 1 [Multimedia I]
วิชาการผลิตมัลติมีเดีย 1 [Multimedia I]วิชาการผลิตมัลติมีเดีย 1 [Multimedia I]
วิชาการผลิตมัลติมีเดีย 1 [Multimedia I]Pakornkrits
 
เขียนเว็บไซต์ด้วย Html 5
เขียนเว็บไซต์ด้วย Html 5เขียนเว็บไซต์ด้วย Html 5
เขียนเว็บไซต์ด้วย Html 5Samart Phetdee
 
Bootstrap 3 สำหรับมือใหม่ | CloudCourse.io
Bootstrap 3 สำหรับมือใหม่ | CloudCourse.ioBootstrap 3 สำหรับมือใหม่ | CloudCourse.io
Bootstrap 3 สำหรับมือใหม่ | CloudCourse.ioThapwaris Chinsirirathkul
 
เอกสารประกอบการเรียน ภาษา HTML เบื้องต้น
เอกสารประกอบการเรียน  ภาษา HTML เบื้องต้นเอกสารประกอบการเรียน  ภาษา HTML เบื้องต้น
เอกสารประกอบการเรียน ภาษา HTML เบื้องต้นKon Bannok
 
คู่มือภาษา HTML และการจัดข้อความ
คู่มือภาษา HTML และการจัดข้อความคู่มือภาษา HTML และการจัดข้อความ
คู่มือภาษา HTML และการจัดข้อความPakornkrits
 
การแทรกเลขหน้า MS-Word 2007 มืออาชีพขั้นสูงระดับเทพฯ
การแทรกเลขหน้า MS-Word 2007 มืออาชีพขั้นสูงระดับเทพฯการแทรกเลขหน้า MS-Word 2007 มืออาชีพขั้นสูงระดับเทพฯ
การแทรกเลขหน้า MS-Word 2007 มืออาชีพขั้นสูงระดับเทพฯPakornkrits
 

Viewers also liked (20)

Seasion7
Seasion7Seasion7
Seasion7
 
Seasion5
Seasion5Seasion5
Seasion5
 
Session3
Session3Session3
Session3
 
Session1+2
Session1+2Session1+2
Session1+2
 
Session8
Session8Session8
Session8
 
Session4
Session4Session4
Session4
 
Php & mysql
Php & mysqlPhp & mysql
Php & mysql
 
Phptraining
PhptrainingPhptraining
Phptraining
 
การเขียนเว็บเพจด้วยภาษา HTML
การเขียนเว็บเพจด้วยภาษา HTMLการเขียนเว็บเพจด้วยภาษา HTML
การเขียนเว็บเพจด้วยภาษา HTML
 
สมัคร และการใช้งาน Google drive
สมัคร และการใช้งาน Google driveสมัคร และการใช้งาน Google drive
สมัคร และการใช้งาน Google drive
 
ความรู้เบื้องต้นเกี่ยวกับสื่อสิ่งพิมพ์
ความรู้เบื้องต้นเกี่ยวกับสื่อสิ่งพิมพ์ความรู้เบื้องต้นเกี่ยวกับสื่อสิ่งพิมพ์
ความรู้เบื้องต้นเกี่ยวกับสื่อสิ่งพิมพ์
 
การประดับแพรแถบย่อของเครื่องราชอิสริยาภรณ์
การประดับแพรแถบย่อของเครื่องราชอิสริยาภรณ์การประดับแพรแถบย่อของเครื่องราชอิสริยาภรณ์
การประดับแพรแถบย่อของเครื่องราชอิสริยาภรณ์
 
Php training
Php trainingPhp training
Php training
 
การใช งานโปรแกรม Dreamweaver cs6
การใช งานโปรแกรม Dreamweaver cs6การใช งานโปรแกรม Dreamweaver cs6
การใช งานโปรแกรม Dreamweaver cs6
 
วิชาการผลิตมัลติมีเดีย 1 [Multimedia I]
วิชาการผลิตมัลติมีเดีย 1 [Multimedia I]วิชาการผลิตมัลติมีเดีย 1 [Multimedia I]
วิชาการผลิตมัลติมีเดีย 1 [Multimedia I]
 
เขียนเว็บไซต์ด้วย Html 5
เขียนเว็บไซต์ด้วย Html 5เขียนเว็บไซต์ด้วย Html 5
เขียนเว็บไซต์ด้วย Html 5
 
Bootstrap 3 สำหรับมือใหม่ | CloudCourse.io
Bootstrap 3 สำหรับมือใหม่ | CloudCourse.ioBootstrap 3 สำหรับมือใหม่ | CloudCourse.io
Bootstrap 3 สำหรับมือใหม่ | CloudCourse.io
 
เอกสารประกอบการเรียน ภาษา HTML เบื้องต้น
เอกสารประกอบการเรียน  ภาษา HTML เบื้องต้นเอกสารประกอบการเรียน  ภาษา HTML เบื้องต้น
เอกสารประกอบการเรียน ภาษา HTML เบื้องต้น
 
คู่มือภาษา HTML และการจัดข้อความ
คู่มือภาษา HTML และการจัดข้อความคู่มือภาษา HTML และการจัดข้อความ
คู่มือภาษา HTML และการจัดข้อความ
 
การแทรกเลขหน้า MS-Word 2007 มืออาชีพขั้นสูงระดับเทพฯ
การแทรกเลขหน้า MS-Word 2007 มืออาชีพขั้นสูงระดับเทพฯการแทรกเลขหน้า MS-Word 2007 มืออาชีพขั้นสูงระดับเทพฯ
การแทรกเลขหน้า MS-Word 2007 มืออาชีพขั้นสูงระดับเทพฯ
 

Similar to Lab#4

Similar to Lab#4 (6)

สร้าง Style ด้วย css 3
สร้าง Style ด้วย css 3สร้าง Style ด้วย css 3
สร้าง Style ด้วย css 3
 
ภาษา css
ภาษา cssภาษา css
ภาษา css
 
Workshop Advance CSS3 animation
Workshop Advance CSS3 animationWorkshop Advance CSS3 animation
Workshop Advance CSS3 animation
 
การสร้างเว็บด้วยภาษา Html อย่างง่าย
การสร้างเว็บด้วยภาษา Html อย่างง่ายการสร้างเว็บด้วยภาษา Html อย่างง่าย
การสร้างเว็บด้วยภาษา Html อย่างง่าย
 
ทบทวน Html
ทบทวน Htmlทบทวน Html
ทบทวน Html
 
ICT with Web site
ICT with Web siteICT with Web site
ICT with Web site
 

More from palm2816

Lab#10 navigation, links and hover rollovers
Lab#10 navigation, links and hover rolloversLab#10 navigation, links and hover rollovers
Lab#10 navigation, links and hover rolloverspalm2816
 
Java script 9786169103004_ch02
Java script 9786169103004_ch02Java script 9786169103004_ch02
Java script 9786169103004_ch02palm2816
 
Lab#1 good bad design
Lab#1 good bad designLab#1 good bad design
Lab#1 good bad designpalm2816
 

More from palm2816 (7)

Lab#10 navigation, links and hover rollovers
Lab#10 navigation, links and hover rolloversLab#10 navigation, links and hover rollovers
Lab#10 navigation, links and hover rollovers
 
Lab7
Lab7Lab7
Lab7
 
Lab#6
Lab#6Lab#6
Lab#6
 
Java script 9786169103004_ch02
Java script 9786169103004_ch02Java script 9786169103004_ch02
Java script 9786169103004_ch02
 
Lab#3
Lab#3Lab#3
Lab#3
 
Lab#2
Lab#2Lab#2
Lab#2
 
Lab#1 good bad design
Lab#1 good bad designLab#1 good bad design
Lab#1 good bad design
 

Lab#4

  • 1. HTML5 NEW ELEMENT 322432 Web Design Technology
  • 2.
  • 3. Syntax HTML5 <!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> The content of the document...... </body> </html>
  • 4. HTML5 New Elements TAG Description Canvas ใช้ในการวาดกราฟิก Example <canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;"> Your browser does not support the HTML5 canvas tag. </canvas>
  • 5. New media element Tag Description <audio> สาหรับเล่นไฟล์เสียง <video> สาหรับเล่นไฟล์วิดีโอ <source> มีเดียไฟล์ <embed> การเพิ่มปลั๊กอิน <track> อธิบายแท๊กสาหรับไฟล์วิดีโอและไฟล์เสียง ตัวอย่าง <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4”> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video>
  • 6. New Form Element Tag Description <datalist> Specifies a list of pre- defined options for input controls <keygen> Defines a key-pair generator field (for forms) < output> Defines the result of a calculation
  • 7. Canvas Draw Onto The Canvas With JavaScript Example <script> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.fillStyle="#FF0000"; ctx.fillRect(0,0,150,75); </script> First, find the <canvas> element: The fillRect(x,y,width,height) X Y
  • 8. Example Canvas //Circle var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.beginPath(); ctx.arc(95,50,40,0,2*Math.PI); ctx.stroke(); //Text var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.font="30px Arial"; ctx.fillText("Hello World",10,50);
  • 9. Canvas – Gradients Example var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); // Create gradient var grd=ctx.createLinearGradient(0,0,200,0); grd.addColorStop(0,"red"); grd.addColorStop(1,"white"); // Fill with gradient ctx.fillStyle=grd; ctx.fillRect(10,10,150,80);
  • 10. Canvas - Images Example <p>Image to use:</p> <img id="scream" src="img_the_scream.jpg" alt="The Scream" width="220" height="277"><p>Canvas:</p> <canvas id="myCanvas" width="250" height="300" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag.</canvas> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); var img=document.getElementById("scream"); ctx.drawImage(img,10,10);
  • 11. LAB#4 New Element HTML5 ให้นักศึกษาสร้างเว็บเพจ HTML5 โดยให้มี Canvas และมีการแทรกวิดีโอไฟล์แบบ HTML5 นาเสนอให้สวยงาม คะแนนเต็ม 10 คะแนน ตามความยากง่ายของงานและความสวยงาม ========= ส่งในชั่วโมง ========================