https://github.com/ducksoupdev/svg-example
Sample SVG implementations
https://github.com/ducksoupdev/svg-example
Last synced: 3 months ago
JSON representation
Sample SVG implementations
- Host: GitHub
- URL: https://github.com/ducksoupdev/svg-example
- Owner: ducksoupdev
- Created: 2017-08-14T09:55:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-14T09:56:41.000Z (almost 9 years ago)
- Last Synced: 2025-03-06T00:31:26.844Z (over 1 year ago)
- Language: HTML
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SVG implementation examples
This repo contains sample HTML and CSS for implementing SVGs.
## `img` tag
Just as you would with any other image.
```html
```
## CSS `background-image`
It's best not to base64 encode them as it this will block the loading of the rest of the styles while it downloads.
```html
```
```css
#sample {
background-image: url(freesample.svg);
background-size: contain;
width: 354px;
height: 294px;
display: inline-block;
}
```
## `svg` tag
This can be used to embed an SVG fragment inside the current document. It has its own viewport and coordinate system.
```html
```
```svg
```
```css
svg.sample {
width: 354px;
height: 294px;
display: inline-block;
}
```