0

Hey folks! What's the difference between translate and margin in terms of positioning in CSS?

DIFFERENCE OF MARGIN AND TRANSLATE

2nd Mar 2021, 11:25 AM
Jonel Hatwell
Jonel Hatwell - avatar
1 Answer
+ 2
The translate() method moves an element from its current position (according to the parameters given for the X-axis and the Y-axis). For example: transform: translate(50px, 100px); 50px from X-axis and 100px from Y-axis. Margin The CSS margin properties are used to create space around elements, outside of any defined borders. With CSS, you have full control over the margins. There are properties for setting the margin for each side of an element (top, right, bottom, and left). For example: margin: 10px 15px 20px 25px; 10px from Too 15px from right 20px from bottom And 25px from left. I hope it helps you for more see this lesson: https://www.sololearn.com/learn/CSS/2251/
2nd Mar 2021, 12:00 PM
Matias
Matias - avatar