Skip to content

Instantly share code, notes, and snippets.

@ggendre
Forked from anonymous/ninepatch.css
Last active December 11, 2015 17:38
Show Gist options
  • Save ggendre/4635402 to your computer and use it in GitHub Desktop.
Save ggendre/4635402 to your computer and use it in GitHub Desktop.
/*
Use this code to create a background with a nine patch image.
here, 22px is the size of a corner. the full image should have 4 corners of the same width & height.
And be bigger than 44x44 in this case.
Non symetrical images is also possible but far more complicated.
*/
.ninepatch{
border-width: 22px;
border-image: url(img/content_background.png) 22 22 22 22 repeat;
-webkit-border-image: url(img/content_background.png) 22 22 22 22 repeat;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment