SVG는 Scalable Vector Graphics를 나타내며 XML로 2D 그래픽 및 그래픽 응용 프로그램을 설명하기 위한 언어이며 XML은 SVG 뷰어에 의해 렌더링됩니다.
예시
SVG의 예를 살펴보겠습니다 −
<!DOCTYPE html>
<html>
<head>
<style>
#svgelem {
position: relative;
left: 50%;
-webkit-transform: translateX(-20%);
-ms-transform: translateX(-20%);
transform: translateX(-20%);
}
</style>
<title>SVG</title>
<meta charset="utf-8" />
</head>
<body>
<h2>HTML5 SVG Circle</h2>
<svg id = "svgelem" height = "200" xmlns = "https://www.w3.org/2000/svg">
<circle id = "redcircle" cx = "50" cy = "50" r = "50" fill = "red" />
</svg>
</body>
</html> 중앙에 맞추려면 다음과 같이 CSS를 추가하세요. -
# svgelem {
margin-left:auto;
margin-right:auto;
display:block;
}