Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Заголовок документа</title> <style> body { background-color: #eee; font-size: 1.1em; font-family: 'Roboto', Helvetica, sans-serif; } .container { margin: 10px auto; max-width: 700px; } .wrap { width: 150px; height: 150px; border: 2px solid #666; display: inline-block; margin: 100px; } .box { width: 150px; height: 150px; position: relative; color: #eee; text-align: center; line-height: 150px; -webkit-transform: rotate(25deg); -ms-transform: rotate(25deg); transform: rotate(25deg); } .a { background-color: #0747af; } .b { background-color: #40b530; -webkit-transform-origin: top left; -ms-transform-origin: top left; transform-origin: top left; } .c { background-color: #666; -webkit-transform-origin: 90% 120%; -ms-transform-origin: 90% 120%; transform-origin: 90% 120%; } .d { background-color: #ffdb11; -webkit-transform-origin: 80px 40px; -ms-transform-origin: 80px 40px; transform-origin: 80px 40px; } </style> </head> <body> <h2>Пример свойства transform-origin</h2> <div class="container"> <div class="wrap"> <div class="box a"> 50% 50% </div> </div> <div class="wrap"> <div class="box b"> top left </div> </div> <div class="wrap"> <div class="box c"> 90% 120% </div> </div> <div class="wrap"> <div class="box d"> 80px 40px </div> </div> </div> </body> </html>