Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. A <div></div> is supposed to be rectangle or square, can we use html5 or any other method of web technology to make it appear like a rhombus?
  2. #rhombusDiv {
  3.  width: 150px;
  4.  height: 100px;
  5.  -webkit-transform: skew(20deg);
  6.  -moz-transform: skew(20deg);
  7.  -o-transform: skew(20deg);
  8.   background: blue;
  9.  }
  10.        
  11. <div id="r_paper"></div>
  12.        
  13. var paper = Raphael( "r_paper" );
  14. paper.path(
  15.     "m10,140 l125,-100 l125,100 l-125,100 l-125,-100"
  16. ).attr({
  17.     'stroke-width': 5, fill: 'crimson'
  18. });
  19.        
  20. #r_paper {
  21.     position: absolute;
  22.     width:270px; height:270px;
  23.     left: 100px; top:100px
  24. }