Cut Corners using CSS

If the parent element has a solid color background, you can use pseudo-elements to create the effect: div { height: 300px; background: red; position: relative; } div:before { content: ”; position: absolute; top: 0; right: 0; border-top: 80px solid white; border-left: 80px solid red; width: 0; } <div></div> http://jsfiddle.net/2bZAW/ P.S. The upcoming border-corner-shape is exactly … Read more

How can I show only corner borders?

Assuming <div id=”content”>CONTENT</div> and that CONTENT includes at least one HTML node. #content {position:relative} #content:before, #content:after, #content>:first-child:before, #content>:first-child:after { position:absolute; content:’ ‘; width:80px; height: 80px; border-color:red; /* or whatever colour */ border-style:solid; /* or whatever style */ } #content:before {top:0;left:0;border-width: 1px 0 0 1px} #content:after {top:0;right:0;border-width: 1px 1px 0 0} #content>:first-child:before {bottom:0;right:0;border-width: 0 1px 1px … Read more

How can I create a “tooltip tail” using pure CSS?

Here’s an example with a box-shadow, all latest version browsers should support this http://jsfiddle.net/MZXCj/1/ HTML: <div id=”toolTip”> <p>i can haz css tooltip</p> <div id=”tailShadow”></div> <div id=”tail1″></div> <div id=”tail2″></div> </div> CSS: body {font-family:Helvetica,Arial,sans-serif;} #toolTip { position:relative; } #toolTip p { padding:10px; background-color:#f9f9f9; border:solid 1px #a0c7ff; -moz-border-radius:5px;-ie-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;border-radius:5px; } #tailShadow { position:absolute; bottom:-8px; left:28px; width:0;height:0; border:solid 2px #fff; … Read more

How to draw a checkmark / tick using CSS?

You can draw two rectangles and place them next to each other. And then rotate by 45 degrees. Modify the width/height/top/left parameters for any variation. DEMO 1 DEMO 2 (With circle) HTML <span class=”checkmark”> <div class=”checkmark_stem”></div> <div class=”checkmark_kick”></div> </span> CSS .checkmark { display:inline-block; width: 22px; height:22px; -ms-transform: rotate(45deg); /* IE 9 */ -webkit-transform: rotate(45deg); /* … Read more