.wrapper
{
width: 200px;
height: 200px;
margin-left: 150px;
margin-top: 150px;
border: 1px solid green;
}
.triangle
{
width: 100%;
height: 100%;
background:
linear-gradient(to right top, transparent 36.8%, #8d4 36.8%, #8d4 50%, transparent 50%),
white;
box-shadow: 0 0 5px aqua;
transform:
scaleX(.7) /* ужимаем координатную сетку по горизонтали */
translateY(11%) /*двигаем по-вертикали*/
scaleY(.864) /*относительно получившегося центра фигуры, мы ещё и ужимаем вертикальную координатную сетку*/
rotate(-45deg) /*относительно текущего центра фигуры и по изменённым по горизонтали и вертикали координатным сеткам делаем поворот. хоть относительно новых сеток у нас прямоугольник, в оригинале у нас квадрат, поэтому при вращении неожиданно вылезает ромбик :-) */
;
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.