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
div { | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
width: 400px; | |
height: 400px; | |
margin-left: -200px; | |
margin-top: -200px; | |
} |
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
DIV { | |
position: absolute; | |
background-color: #333333; | |
bottom:0; | |
top:0; | |
right:0; | |
left: 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
body { | |
position: absolute; | |
background-color: #333333; | |
bottom:0; | |
top:0; | |
right:0; | |
left: 0; | |
} | |
#blueDiv { | |
position:absolute; |
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
.lead { | |
background: rgba(255, 255, 255, 0.2); | |
width: 60%; | |
margin-left: auto; | |
margin-right: auto; | |
position: absolute; | |
top: 40%; | |
height: 35px; | |
left: 20%; | |
border: 1px solid #000000; |
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
function isBigEnough(element, index, array) { | |
return (element >= 10); | |
} | |
var filtered = [12, 5, 8, 130, 44].filter(isBigEnough); | |
// filtered is [12, 130, 44] |
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
var now = new Date(); | |
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); | |
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December'); | |
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate(); | |
function fourdigits(number) { | |
return (number < 1000) ? number + 1900 : number; |
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
function isBreakPoint(bp) { | |
// The breakpoints that you set in your css | |
var bps = [320, 480, 768, 1024]; | |
var w = $(window).width(); | |
var min, max; | |
for (var i = 0, l = bps.length; i < l; i++) { | |
if (bps[i] === bp) { | |
min = bps[i-1] || 0; | |
max = bps[i]; | |
break; |
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
$(element) | |
.data('counter', 0) // begin counter at zero | |
.click(function() { | |
var counter = $(this).data('counter'); // get | |
$(this).data('counter', counter + 1); // set | |
// do something else... | |
}); |
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
<figure> | |
<img src="path/to/image" alt="About image" /> | |
<figcaption> | |
<p>This is an image of something interesting. </p> | |
</figcaption> | |
</figure> |
OlderNewer