Created
March 1, 2013 17:22
-
-
Save erbmicha/5066232 to your computer and use it in GitHub Desktop.
CSS using background-origin to keep background-image tied to content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* lined paper example */ | |
line-height: 1.2; | |
background-image: linear-gradient(rgba(0,0,0,.3) 1px, transparent 1px); | |
background-size: 100% 1.2em; | |
background-position: 0 .8em; | |
background-origin: content-box; | |
padding: 1em; | |
/* code editor example */ | |
line-height: 1.5; | |
background-image: linear-gradient(beige 50%, white 50%); | |
background-size: 100% 3em; | |
background-origin: content-box; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment