значения свойства:
* {
margin
:
0
;
padding
}
.main {
height
600px
width
900px
position
absolute
top
50%
left
margin-top
-300px
margin-left
-450px
.wrapper {
33.3%
100%
float
#div
1
, #div
2
3
{
200px
relative
-100px
border
1px
solid
#F00
#d
, #d
100px
-50px
background-color
#3BA9DE
text-align
center
line-height
transform: rotate(
45
deg);
-moz-transform: rotate(
-o-transform: rotate(
-webkit-transform: rotate(
-ms-transform: rotate(
transform-origin:
20%
-moz-transform-origin:
-o-transform-origin:
-webkit-transform-origin:
-ms-transform-origin:
* { margin: 0; padding: 0; } .main { height: 600px; width: 900px; position: absolute; top: 50%; left: 50%; margin-top: -300px; margin-left: -450px; } .wrapper { width: 33.3%; height: 100%; float: left; } #div1, #div2, #div3 { height: 200px; width: 200px; float: left; position: relative; top: 50%; left: 50%; margin-top: -100px; margin-left: -100px; border: 1px solid #F00; } #d1, #d2, #d3 { height: 100px; width: 100px; float: left; position: relative; top: 50%; left: 50%; margin-top: -50px; margin-left: -50px; background-color: #3BA9DE; text-align: center; line-height: 100px; transform: rotate(45deg); -moz-transform: rotate(45deg); -o-transform: rotate(45deg); -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); } #d1 { transform-origin: 20% 0; -moz-transform-origin: 20% 0; -o-transform-origin: 20% 0; -webkit-transform-origin: 20% 0; -ms-transform-origin: 20% 0; } #d2 { -moz-transform-origin: 0 20%; -o-transform-origin: 0 20%; -webkit-transform-origin: 0 20%; }
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
link
href
"css/style.css"
rel
"stylesheet"
script
type
"text/javascript"
src
"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
></
</
body
div
class
"main"
"wrapper"
id
"div1"
"d1"
>B</
"div2"
"d2"
>S</
"div3"
"d3"
>M</
/*JavaScript*/
document.getElementById("d2").style.transformOrigin="0 20%";
document.getElementById("d2").style.msTransformOrigin="0 20%";
/*jQuery*/
$(document).ready(function() {
$("#d3").css({ "transform-origin": "20% 20%" });
$("#d3").css({ "-moz-transform-origin": "20% 20%" });
$("#d3").css({ "-o-transform-origin": "20% 20%" });
$("#d3").css({ "-webkit-transform-origin": "20% 20%" });
$("#d3").css({ "-ms-transform-origin": "20% 20%" });
});