กลยุทธ์การย้ายแบบค่อยเป็นค่อยไป (Progressive Enhancement)
- เปลี่ยน DOCTYPE:
<!DOCTYPE html> - ใช้ Semantic Elements:
<section>, <article>, <nav>, <header>, <footer>(ร่วมกับ<div>ได้) - ใช้ Form Controls ใหม่:
type="email", "url", "date"- เบราว์เซอร์เก่าจะ fallback เป็นtype="text"เอง - Media Elements:
<video>, <audio>ใส่ Fallback Content ไว้ข้างใน
สำหรับ Legacy IE (IE6-8)
ใช้ html5shiv (สร้าง Elements ให้รู้จัก) + Respond.js (Media Queries Polyfill)
<!--[if lt IE 9]>
<script src="html5shiv.min.js"></script>
<script src="respond.min.js"></script>
<![endif]-->
วิธีนี้ให้ใช้ HTML5 ได้วันนี้ พร้อมรองรับ Browser เก่า