123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <table>
  <tbody>
    <tr>
      <th scope="col">&nbsp;&nbsp;&nbsp;URLencode&nbsp;🡆<br>charset&nbsp;🡇</th>
      <th scope="col">all<br>&nbsp;"<i>%3Csvg%20xmlns</i>&nbsp;"&nbsp;</th>
      <th scope="col">none<br>&nbsp;"<i>&#x3C;svg xmlns</i>&nbsp;"&nbsp;</th>
      <th scope="col">all but spaces<br>&nbsp;"<i>%3Csvg&nbsp;xmlns</i>&nbsp;"&nbsp;</th>
    </tr>
    <tr>
      <th scope="row">full<br />&nbsp;"<i>charset=utf-8,</i>&nbsp;"&nbsp;</th>
      <td class="charset-full_encode-all">&nbsp;</td>
      <td class="charset-full_encode-none">&nbsp;</td>
      <td class="charset-full_encode-nospaces">&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">none</th>
      <td class="charset-none_encode-all">&nbsp;</td>
      <td class="charset-none_encode-none">&nbsp;</td>
      <td class="charset-none_encode-nospaces">&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">shorthand<br />&nbsp;"<i>utf-8,</i>&nbsp;"&nbsp;</th>
      <td class="charset-shorthand_encode-all">&nbsp;</td>
      <td class="charset-shorthand_encode-none">&nbsp;</td>
      <td class="charset-shorthand_encode-nospaces">&nbsp;</td>
    </tr>
  </tbody>
</table>

<div>
<h1>Compatibility issues of SVG in CSS data URIs</h1><p> The table above contains nice cells with</p><ul><li><b>a blue background</b> (<i>background-color:#555599;</i>&nbsp;)</li><li><b>SVG background image of moon</b> (<i>background-image:url('data:image/svg+xml;...</i>&nbsp;)</li></ul><p>Even though the CSS is <a target="_blank" href="https://jigsaw.w3.org/css-validator/validator"> officially valid</a>, depending on your current browser, the SVG background may not render in some cells, depending on the contents and format of the CSS background-image URI.</p><p>Each of the blue cells contains a unique combination of</p><ul><li>definition of encoding (rows)</li><li>encoding of the SVG itself (columns)</li></ul><p>More on this is contained in the following post about <a target="_blank" href="https://sparkx.online/svg-css-backgrounds/">SVG in CSS backgrounds</a> post, inlcluding info on <a target="_blank" href="https://sparkx.online/svg-css-backgrounds/#optimizing-svg">SVG optimization</a> for smaller file sizes, <a target="_blank" href="https://sparkx.online/svg-css-backgrounds/#converting-to-svg">Converting to SVG from other formats</a>, etc.</p></div>


            
          
!
            
              .charset-full_encode-all{
background-image:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221%22%20viewBox%3D%220%200%20225%20225%22%3E%3Cpath%20d%3D%22M0%200zm118%2011c3%200%207-1%209%202%202%202%201%205-1%206a92%2092%200%200%200-3%20116c16%2023%2044%2037%2072%2037%202%200%205%200%206%202%202%202%200%205-1%207-16%2017-38%2029-61%2032A101%20101%200%200%201%2051%2043c17-19%2042-30%2067-32M43%2069a92%2092%200%200%200%2021%20114%2092%2092%200%200%200%20115%205l8-8a101%20101%200%200%201-90-83c-5-23%200-48%2012-68l4-8c-29%203-56%2022-70%2048z%22%2F%3E%3Cpath%20fill%3D%22%23ebebeb%22%20d%3D%22M43%2069c14-26%2041-45%2070-48l-4%208a101%20101%200%200%200%2078%20151l-8%208a92%2092%200%200%201-115-5A92%2092%200%200%201%2043%2069z%22%2F%3E%3C%2Fsvg%3E')}

.charset-full_encode-none{
background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 225 225"><path d="M0 0zm118 11c3 0 7-1 9 2 2 2 1 5-1 6a92 92 0 0 0-3 116c16 23 44 37 72 37 2 0 5 0 6 2 2 2 0 5-1 7-16 17-38 29-61 32A101 101 0 0 1 51 43c17-19 42-30 67-32M43 69a92 92 0 0 0 21 114 92 92 0 0 0 115 5l8-8a101 101 0 0 1-90-83c-5-23 0-48 12-68l4-8c-29 3-56 22-70 48z"/><path fill="#ebebeb" d="M43 69c14-26 41-45 70-48l-4 8a101 101 0 0 0 78 151l-8 8a92 92 0 0 1-115-5A92 92 0 0 1 43 69z"/></svg>')}

.charset-full_encode-nospaces{
background-image:url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 version%3D%221%22 viewBox%3D%220 0 225 225%22%3E%3Cpath d%3D%22M0 0zm118 11c3 0 7-1 9 2 2 2 1 5-1 6a92 92 0 0 0-3 116c16 23 44 37 72 37 2 0 5 0 6 2 2 2 0 5-1 7-16 17-38 29-61 32A101 101 0 0 1 51 43c17-19 42-30 67-32M43 69a92 92 0 0 0 21 114 92 92 0 0 0 115 5l8-8a101 101 0 0 1-90-83c-5-23 0-48 12-68l4-8c-29 3-56 22-70 48z%22%2F%3E%3Cpath fill%3D%22%23ebebeb%22 d%3D%22M43 69c14-26 41-45 70-48l-4 8a101 101 0 0 0 78 151l-8 8a92 92 0 0 1-115-5A92 92 0 0 1 43 69z%22%2F%3E%3C%2Fsvg%3E')}

.charset-none_encode-all{
background-image:url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221%22%20viewBox%3D%220%200%20225%20225%22%3E%3Cpath%20d%3D%22M0%200zm118%2011c3%200%207-1%209%202%202%202%201%205-1%206a92%2092%200%200%200-3%20116c16%2023%2044%2037%2072%2037%202%200%205%200%206%202%202%202%200%205-1%207-16%2017-38%2029-61%2032A101%20101%200%200%201%2051%2043c17-19%2042-30%2067-32M43%2069a92%2092%200%200%200%2021%20114%2092%2092%200%200%200%20115%205l8-8a101%20101%200%200%201-90-83c-5-23%200-48%2012-68l4-8c-29%203-56%2022-70%2048z%22%2F%3E%3Cpath%20fill%3D%22%23ebebeb%22%20d%3D%22M43%2069c14-26%2041-45%2070-48l-4%208a101%20101%200%200%200%2078%20151l-8%208a92%2092%200%200%201-115-5A92%2092%200%200%201%2043%2069z%22%2F%3E%3C%2Fsvg%3E')}
.charset-none_encode-none{
background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 225 225"><path d="M0 0zm118 11c3 0 7-1 9 2 2 2 1 5-1 6a92 92 0 0 0-3 116c16 23 44 37 72 37 2 0 5 0 6 2 2 2 0 5-1 7-16 17-38 29-61 32A101 101 0 0 1 51 43c17-19 42-30 67-32M43 69a92 92 0 0 0 21 114 92 92 0 0 0 115 5l8-8a101 101 0 0 1-90-83c-5-23 0-48 12-68l4-8c-29 3-56 22-70 48z"/><path fill="#ebebeb" d="M43 69c14-26 41-45 70-48l-4 8a101 101 0 0 0 78 151l-8 8a92 92 0 0 1-115-5A92 92 0 0 1 43 69z"/></svg>')}

.charset-none_encode-nospaces{
background-image:url('data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 version%3D%221%22 viewBox%3D%220 0 225 225%22%3E%3Cpath d%3D%22M0 0zm118 11c3 0 7-1 9 2 2 2 1 5-1 6a92 92 0 0 0-3 116c16 23 44 37 72 37 2 0 5 0 6 2 2 2 0 5-1 7-16 17-38 29-61 32A101 101 0 0 1 51 43c17-19 42-30 67-32M43 69a92 92 0 0 0 21 114 92 92 0 0 0 115 5l8-8a101 101 0 0 1-90-83c-5-23 0-48 12-68l4-8c-29 3-56 22-70 48z%22%2F%3E%3Cpath fill%3D%22%23ebebeb%22 d%3D%22M43 69c14-26 41-45 70-48l-4 8a101 101 0 0 0 78 151l-8 8a92 92 0 0 1-115-5A92 92 0 0 1 43 69z%22%2F%3E%3C%2Fsvg%3E')}

.charset-shorthand_encode-all{
background-image:url('data:image/svg+xml;utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221%22%20viewBox%3D%220%200%20225%20225%22%3E%3Cpath%20d%3D%22M0%200zm118%2011c3%200%207-1%209%202%202%202%201%205-1%206a92%2092%200%200%200-3%20116c16%2023%2044%2037%2072%2037%202%200%205%200%206%202%202%202%200%205-1%207-16%2017-38%2029-61%2032A101%20101%200%200%201%2051%2043c17-19%2042-30%2067-32M43%2069a92%2092%200%200%200%2021%20114%2092%2092%200%200%200%20115%205l8-8a101%20101%200%200%201-90-83c-5-23%200-48%2012-68l4-8c-29%203-56%2022-70%2048z%22%2F%3E%3Cpath%20fill%3D%22%23ebebeb%22%20d%3D%22M43%2069c14-26%2041-45%2070-48l-4%208a101%20101%200%200%200%2078%20151l-8%208a92%2092%200%200%201-115-5A92%2092%200%200%201%2043%2069z%22%2F%3E%3C%2Fsvg%3E')}

.charset-shorthand_encode-none{
background-image:url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 225 225"><path d="M0 0zm118 11c3 0 7-1 9 2 2 2 1 5-1 6a92 92 0 0 0-3 116c16 23 44 37 72 37 2 0 5 0 6 2 2 2 0 5-1 7-16 17-38 29-61 32A101 101 0 0 1 51 43c17-19 42-30 67-32M43 69a92 92 0 0 0 21 114 92 92 0 0 0 115 5l8-8a101 101 0 0 1-90-83c-5-23 0-48 12-68l4-8c-29 3-56 22-70 48z"/><path fill="#ebebeb" d="M43 69c14-26 41-45 70-48l-4 8a101 101 0 0 0 78 151l-8 8a92 92 0 0 1-115-5A92 92 0 0 1 43 69z"/></svg>')}

.charset-shorthand_encode-nospaces{
background-image:url('data:image/svg+xml;utf-8,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 version%3D%221%22 viewBox%3D%220 0 225 225%22%3E%3Cpath d%3D%22M0 0zm118 11c3 0 7-1 9 2 2 2 1 5-1 6a92 92 0 0 0-3 116c16 23 44 37 72 37 2 0 5 0 6 2 2 2 0 5-1 7-16 17-38 29-61 32A101 101 0 0 1 51 43c17-19 42-30 67-32M43 69a92 92 0 0 0 21 114 92 92 0 0 0 115 5l8-8a101 101 0 0 1-90-83c-5-23 0-48 12-68l4-8c-29 3-56 22-70 48z%22%2F%3E%3Cpath fill%3D%22%23ebebeb%22 d%3D%22M43 69c14-26 41-45 70-48l-4 8a101 101 0 0 0 78 151l-8 8a92 92 0 0 1-115-5A92 92 0 0 1 43 69z%22%2F%3E%3C%2Fsvg%3E')}

table{
  background:#aaa;
  font-family:sans-serif
}
th,td{
  width:7rem;
  height:7rem;
}
td{
  /*background:#559 none no-repeat 0 2rem/5rem;*/
  background-color:#555599;
  background-position:0 2rem;
  background-size:5rem;
  background-repeat:no-repeat;
  text-align:left;
  vertical-align:top;
}
th{
  background-color:#ccc;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console