Last active
August 29, 2015 14:02
-
-
Save FranciscoG/b43a912f35446bdc5f4b to your computer and use it in GitHub Desktop.
some helpful css that I keep forgetting and looking up so I'm finally saving it here
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
/* | |
sources: | |
http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/ | |
http://jsfiddle.net/necolas/rZvEF/ | |
*/ | |
/* ----- REUSABLE IMG BLOCK ----- */ | |
.imgblock { | |
display:block; | |
} | |
.imgblock .img { | |
float:left; | |
display:block; | |
margin:0 5px 0 0; | |
} | |
.imgblock .img img { | |
display:block; | |
} | |
/* | |
* 1. Create new block formatting context in modern browsers | |
* 2. Avoid shrink-wrap behaviour of table-cell | |
* 3. Override for IE6/7 | |
* 4. Create new block formatting context in IE6/7 | |
* Alternatively, use `overflow:hidden` if clipping is OK | |
* www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/ | |
* facebook.com | |
*/ | |
.imgblock .content { | |
display:table-cell; /* 1 */ | |
width:10000px; /* 2 */ | |
*width:auto; /* 3 */ | |
*zoom:1; /* 4 */ | |
} | |
/* Clearfix */ | |
.cf { | |
*zoom:1; | |
} | |
.cf:before, | |
.cf:after { | |
content:""; | |
display:table; | |
} | |
.cf:after { | |
clear:both; | |
} | |
.nobr { | |
white-space: nowrap; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment