.wrap { margin: 2em 3em; position: relative; border: 1px solid #ccc; height: 200px; display: inline-block; width: 200px; white-space: nowrap; } .ori, .trans { width: 150px; height: 100px; border: 1px solid #7a0006; background: #cf0009; left: 50%; top: 50px; margin-left: -75px; position: absolute; } .ori { z-index: 0; opacity: 0.1; } .trans { z-index: 10; opacity: 0.5; background-color: #1564cf; transition: transform 1s; } .rotate1:hover { transform: rotate(20deg) } .rotate2:hover { transform: rotate(-90deg) }
<!DOCTYPE html> <html lang="ko"> <head></head> <body> <div class="wrap"> rotate(20deg) <div class="ori"></div> <div class="trans rotate1">rotate(20deg)</div> </div> <div class="wrap"> rotate(-90deg) <div class="ori"></div> <div class="trans rotate2">rotate(-90deg)</div> </div> </body> </html>