คลังความรู้ ระบบสารสนเทศ

การวาดวงรีสีเหลือบ ด้วย HTML5

โดย สมโภชน์ กุลธารารมณ์

<!doctype html>
<html>
<head><title>Gradient HTML5</title></head>
<body>
<svg id=”svgelem” height=”200″ xmlns=”http://www.w3.org/2000/svg”>
<defs>
<radialGradient id =”gradient” cx=”50%” cy=”50%” r=”50%” fx=”50%” fy=”50%”>
<stop offset=”0%” style=”stop-color:rgb(200,200,200); stop-opacity:0″/>
<stop offset=”100%” style=”stop-color:rgb(0,0,255); stop-opacity:1″/></radialGradient>
</defs>
<ellipse cx=”200″ cy=”100″ rx=”200″ ry=”100″ style=”fill:url(#gradient)”/>
</svg>
</body>
</html>

เมื่อกด Ctrl+/Ctrl- จะเพิ่มขนาดหรือขยายภาพที่วาดไว้ได้ด้วยภาพไม่แตก