This file contains 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
/* | |
Cross-browser (including IE8-10) | |
Más info: http://coding.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/ | |
*/ | |
.absolute-center { | |
/* height: must be declared */ | |
margin: auto; | |
position: absolute; | |
top: 0; left: 0; bottom: 0; right: 0; | |
} |
This file contains 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
.thing-that-moves { | |
position: absolute; | |
width: 100px; | |
height: 100px; | |
background: red; | |
top: 0; | |
left: 0; | |
transition: left 0.5s; /* BYO prefixes */ | |
} | |
@media (min-width: 400px) { |
This file contains 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
.modal { | |
/* some styles to position the modal at the center of the page */ | |
position: fixed; | |
top: 50%; | |
left: 50%; | |
width: 300px; | |
line-height: 200px; | |
height: 200px; | |
margin-left: -150px; | |
margin-top: -100px; |
This file contains 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
#example { | |
position: relative; | |
} | |
#example-checkbox { | |
display: none; | |
} | |
#example-checkbox:checked + #example:after { | |
content: "Hide"; | |
position: absolute; | |
top: 0; |
This file contains 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
-moz-column-count: 3; | |
-moz-column-gap: 5px; | |
-webkit-column-count: 3; | |
-webkit-column-gap: 5px; | |
column-count: 3; | |
column-gap: 5px; |
This file contains 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
.modal{ | |
/* arbitrary styling */ | |
background-color: white; | |
border-radius: 5px; | |
box-shadow: 2px 2px 2px rgba(0,0,0,0.2); | |
height:200px; | |
width:300px; | |
/* change position to fixed if you want to prevent the dialog from scrolling away, and center it */ | |
position:fixed; |
This file contains 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
.my-element { | |
background-image: url(fallback.png); | |
background-image: url(image.svg), none; | |
} |
This file contains 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
text-overflow: ellipsis; |
This file contains 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
<img src="image.svg" onerror="this.src='image.png'; this.onerror=null;"> |
This file contains 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
<svg width="96" height="96"> | |
<image xlink:href="svg.svg" src="svg.png" width="96" height="96" /> | |
</svg> |