Skip to content

Instantly share code, notes, and snippets.

Created February 21, 2012 19:29
  • Star 0 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/1878341 to your computer and use it in GitHub Desktop.
pseudo element as background-size
/* pseudo element as background-size */
* {
margin: 0;
padding: 0;
}
p {
position: relative;
height: 400px;
font-size: 100px;
color: red;
}
p:before {
content: url(http://watduck.jpg.to);
top:0; left: 0; right: 0;
position: absolute;
display: block;
width: 100%;
z-index: -1;
}​
{"view":"split-vertical","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment