Skip to content

Instantly share code, notes, and snippets.

@liusy182
Forked from csssecrets/dabblet.css
Last active September 26, 2015 06:28
Show Gist options
  • Select an option

  • Save liusy182/ddb538698de1ca13dd76 to your computer and use it in GitHub Desktop.

Select an option

Save liusy182/ddb538698de1ca13dd76 to your computer and use it in GitHub Desktop.
Flexible background positioning
/**
* Flexible background positioning
* via extended background-position
*/
div {
background: url(http://csssecrets.io/images/code-pirate.svg)
no-repeat #58a;
background-position: right 20px bottom 50px;
/* Alternative solution
background-position: calc(100%-20px) calc(100% - 50px);
*/
/* Styling */
max-width: 15em;
min-height: 10em;
padding: 10px;
color: white;
font: 100%/1 sans-serif;
}
<div>Code Pirate</div>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment