An open API service indexing awesome lists of open source software.

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

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;
}
```