x-axis और y-axis के साथ एलिमेंट को ट्रांसफॉर्म करने के लिए translate(x,y) मेथड का उपयोग करें।
आइए सिंटैक्स देखें:
translate(x,y)
यहां, x ट्रांसलेटिंग वेक्टर के x-coordinate को दर्शाने वाली लंबाई है।
y ट्रांसलेटिंग वेक्टर के ordinate को दर्शाने वाली लंबाई है।
आइए एक उदाहरण देखें:
div { width: 50px; height: 50px; background-color: orange; } .trans { transform: translate(20px); background-color: black; }