Skip to content

Instantly share code, notes, and snippets.

@adeleinr
Last active December 16, 2015 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeleinr/5423774 to your computer and use it in GitHub Desktop.
Save adeleinr/5423774 to your computer and use it in GitHub Desktop.
CSS Cheatsheet
Center an image in a div
========================
.person .person-avatar-medium {
width: 80px;
height: 80px;
overflow: hidden;
background-color: #f2f2f0;
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
border-radius: 100%;
display: block;
margin-left: auto;
margin-right: auto;
}
Center the contents of a div
============================
person{
margin:auto;
}
Gray out an image
================
.person img:hover{
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-o-filter: grayscale(100%);
-ms-filter: grayscale(100%);
filter: grayscale(100%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment