<rect>

<rect> 요소는 SVG 기본 모형이고 코너의 위치와 폭과 높이에 따라 사각형을 만드는데 사용된다. 또한 모서리가 둥근 사각형을 만들 수 있다.

<svg viewBox="0 0 220 100" xmlns="http://www.w3.org/2000/svg">
  <!-- Simple rect element -->
  <rect x="0" y="0" width="100" height="100" />

  <!-- Rounded corner rect element -->
  <rect x="120" y="0" width="100" height="100" rx="15" ry="15" />
</svg>

컨택스트 사용해보기

카테고리 기본 도형 요소, 그래픽 요소, 모형 요소
허용 된 콘텐츠 Any number of the following elements, in any order:
Animation elements »
Descriptive elements »
규범 문서 SVG 1.1 (2nd Edition)

Example

간단한 rect 사용하기

» rect-1.svg

라운드 코너와 rect 사용하기

» rect-2.svg

속성

전역 속성

지정 속성

DOM Interface

This element implements the SVGRectElement interface.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
rectChrome Full support 1Edge Full support YesFirefox Full support 1.5IE Full support 9Opera Full support 8Safari Full support 3.1WebView Android Full support 3Chrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support 3.1Samsung Internet Android Full support Yes
heightChrome Full support 1Edge Full support YesFirefox Full support 1.5IE Full support 9Opera Full support 8Safari Full support 3.1WebView Android Full support 3Chrome Android Full support YesFirefox Android Full support 4Opera Android ? Safari iOS Full support 3.1Samsung Internet Android Full support Yes
rxChrome Full support 1Edge Full support YesFirefox Full support 1.5IE Full support 9Opera Full support 8Safari Full support 3.1WebView Android Full support 3Chrome Android Full support YesFirefox Android Full support 4Opera Android ? Safari iOS Full support 3.1Samsung Internet Android Full support Yes
ryChrome Full support 1Edge Full support YesFirefox Full support 1.5IE Full support 9Opera Full support 8Safari Full support 3.1WebView Android Full support 3Chrome Android Full support YesFirefox Android Full support 4Opera Android ? Safari iOS Full support 3.1Samsung Internet Android Full support Yes
widthChrome Full support 1Edge Full support YesFirefox Full support 1.5IE Full support 9Opera Full support 8Safari Full support 3.1WebView Android Full support 3Chrome Android Full support YesFirefox Android Full support 4Opera Android ? Safari iOS Full support 3.1Samsung Internet Android Full support Yes
xChrome Full support 1Edge Full support YesFirefox Full support 1.5IE Full support 9Opera Full support 8Safari Full support 3.1WebView Android Full support 3Chrome Android Full support YesFirefox Android Full support 4Opera Android ? Safari iOS Full support 3.1Samsung Internet Android Full support Yes
yChrome Full support 1Edge Full support YesFirefox Full support 1.5IE Full support 9Opera Full support 8Safari Full support 3.1WebView Android Full support 3Chrome Android Full support YesFirefox Android Full support 4Opera Android ? Safari iOS Full support 3.1Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also