SVG <circle>

<circle> -tagia käytetään yhden pyörän luomiseen.

<circle> -tagi

<circle> -tagia käytetään yhden pyörän luomiseen.

Kopioi seuraava koodi muistiinpanoon, tallenna tiedosto nimellä "circle1.svg". Aseta tiedosto verkkohakemistoon:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<circle cx="100" cy="50" r="40" stroke="black"
stroke-width="2" fill="red"/>
</svg>

Koodin selitys:

cx ja cy ominaisuudet määrittävät pyöräpisteen x ja y-koordinaatit. Jos cx ja cy jätetään pois, pyörän keskipiste asetetaan (0, 0)

r-ominaisuus määrittää pyörän säteen.

Näytä esimerkki