Open WangShuXian6 opened 5 years ago
使用
<?xml version="1.0" encoding="UTF-8" ?> <!--XML Name Space:命名空间,指定当前标签用于何种语境--> <svg xmlns="http://www.w3.org/2000/svg" width="200" height="100"> <rect width="100" height="50"></rect> </svg>
![svg](https://user-images.githubusercontent.com/30850497/54582613-5bd27580-4a4c-11e9-9f74-33a6f9565315.jpg)
***
>HTML5之前使用SVG的方法
```html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h3>HTML5之前使用SVG的方法</h3>
<img src="4.svg">
<hr/>
<iframe src="4.svg"></iframe>
<hr/>
<object data="4.svg"></object>
<hr/>
<embed src="4.svg">
</body>
</html>
HTML5之后使用SVG的方法
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <h3>HTML5之后使用SVG的方法</h3> <svg width="600" height="400"> <rect width="300" height="200"></rect> <rect width="300" height="200" x="300" y="200"></rect> </svg> </body> </html>
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <style> body { text-align: center; }
svg {
background: #f0f0f0;
}
#r4 {
/*background: #00f;*/
/*border: 5px solid #00f;*/
fill: #00f;
fill-opacity: .3;
stroke: #00f;
stroke-width: 5px;
}
SVG