Skip to content

Instantly share code, notes, and snippets.

@Cifro
Created January 26, 2011 22:39
Show Gist options
  • Save Cifro/797655 to your computer and use it in GitHub Desktop.
Save Cifro/797655 to your computer and use it in GitHub Desktop.
When will be Opera support CSS3 gradients?
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
// gradient-bg.svg from http://www.display-inline.fr/projects/css-gradient/
// with Opera option
$file = file_get_contents(__DIR__ . '/gradient-bg.svg');
$out = preg_replace("/\s+/", ' ', $file);
$out = base64_encode($out);
$dataurl = 'data:image/svg+xml;base64,';
echo '<pre style="pre-wrap; word-wrap: break-word;">';
echo $dataurl . $out;
echo '</pre>';
echo '<pre style="pre-wrap; word-wrap: break-word;">';
echo 'background-image: url("' . $dataurl . $out . '");';
echo '</pre>';
echo '<pre style="pre-wrap; word-wrap: break-word;">';
echo htmlspecialchars('<img src="' . $dataurl . $out. '">');
echo '</pre>';
echo '<img src="' . $dataurl . $out. '">';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment