svg 로 사각형 그리기



html)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width, height=device-height, 
                     minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0">
    <title>Insert title here</title>
</head>
 
<body>
    <?xml version="1.0"?>
    <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="400px" version="1.1">
        <!-- 
        rect : 사각형
            x : 가로 길이
            y : 세로 길이
            rx, ry : 모서리 라운드
            fill : 배경색
            fill-opacity : 투명도
            stroke : 선색
            stroke-width : 선두께
            stroke-opacity : 선투명도
         --> 
        <rect x="10" y="10" rx="10" ry="10"
              width="100" height="100" 
              style="fill:#ff0000; fill-opacity:0.5; stroke:#000; stroke-width:3;" />
    </svg>
</body>
</html>
cs



결과

+ Recent posts