dog-ear (dôgîr, dg-)n.A turned-down corner of a page in a book.
tr.v. dog-eareddog-ear·ingdog-ears

1. To turn down the corner of (the page of a book).
2. To make worn or shabby from overuse.
Sometimes i'll have the need to have a "Clickable" element within a box or div on a page. Or maybe the box is "marked" with a dog-ear to show that you can click for some more information that is not currently visible. For this article my example is on a day within a calendar.

First I'll build my div:
<div class="mydiv" ></div>
Easy Enough. Now for a bit of style:
<style>
    .myDiv {
        border: #CCC 1px solid; 
        display:inline-block; 
        height:189px; 
        width:156px; 
        border-collapse:collapse; 
        background-color: #FFF;
        position:relative;
    }
</style>
And we have a box. 

Now lets dog ear it. First add another element inside the first div, I'm just using another div:
<divclass="mydiv">
    <div class="mycorner"></div>
</div>
And some style for our corner:
<style>
.mycorner {
width:0px;
height:0px;
border-top: #09F 17px solid;   /*inside part*/
border-right: white 25px solid;   /*outside part*/
position:absolute;
bottom:-1px;
right:-1px;
-webkit-box-shadow: -3px -2px 5px 0px rgba(0,0,0,0.2);
-moz-box-shadow: -3px -2px 5px 0px rgba(0,0,0,0.2);
box-shadow: -3px -2px 5px 0px rgba(0,0,0,0.2);
}
</style>
And as easy as that we have a Great looking folder corner using CSS. No images needed!

A couple parts of this CSS to note:
I made the corner blue so it's easier to see. I also added some shadowing, it just looks better with some depth. (Create shadows easily here:http://www.cssmatic.com/box-shadow. And keep in mind IE still doesn't play nice with shadows)

And to get fancier you could always start with a plain corner and then fold it on hover. Like this:
<style>
.mycorner {
    width:0px;
    height:0px;
    border-top: transparent 17px solid; /*inside part*/
    border-right: transparent 25px solid; /*outside part*/
    position:absolute;
    bottom:0px;
    right:0px;
    -webkit-box-shadow: 3px 2px 5px 0px rgba(0,0,0,0.2);
    -moz-box-shadow: 3px 2px 5px 0px rgba(0,0,0,0.2);
    box-shadow: 3px 2px 5px 0px rgba(0,0,0,0.2);
    cursor:pointer;
}

.mycorner:hover {
    width:0px;
    height:0px;
    border-top: #09F 17px solid; /*inside part*/
    border-right: white 25px solid; /*outside part*/
    position:absolute;
    bottom:-1px;
    right:-1px;
    -webkit-box-shadow: -3px -2px 5px 0px rgba(0,0,0,0.2);
    -moz-box-shadow: -3px -2px 5px 0px rgba(0,0,0,0.2);
    box-shadow: -3px -2px 5px 0px rgba(0,0,0,0.2);
}
</style>
Notice I have the shadow on the outside of the corner to alert the user that the element is active when not hovering.

Play around with this technique and you will see a whole lot of easy to create shapes front strictly CSS. I also use a similar approach to make Pointers/Arrow tips. 

Happy folding!
 
PictureSome Gradients!
Remember when we used to have to use 1 pixel ping image strips for gradients? Often they would be just black or white fading to transparent.

Code would look something like this:

background: url(../images/gradient.png) #EFEFEF bottom repeat-x;
Simple and worked everywhere, right? However, it was not fancy enough and you had to load that huge 2kb ping image.

Well, luckily it's gotten even easier. And here is a code sample:
background: rgb(125,126,125); /* Old browsers */
background: -moz-linear-gradient(top,  rgba(125,126,125,1) 0%, rgba(14,14,14,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(125,126,125,1)), color-stop(100%,rgba(14,14,14,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  rgba(125,126,125,1) 0%,rgba(14,14,14,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  rgba(125,126,125,1) 0%,rgba(14,14,14,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  rgba(125,126,125,1) 0%,rgba(14,14,14,1) 100%); /* IE10+ */
background: linear-gradient(to bottom,  rgba(125,126,125,1) 0%,rgba(14,14,14,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7d7e7d', endColorstr='#0e0e0e',Gradient ); /* IE6-9 */
Ridiculous! 

This is the "new" way and probably, for reasons I don't know and don't care to look up, is the correct way to handle gradients these days. Luckily though, I found a website that helps with this: 

http://www.colorzilla.com/gradient-editor/

They have made a simple to use tool that really takes all the guess work out (hand coding). So if nothing else, this blog will serve as my bookmark back to colorzilla.com's gradient editor/creator.