If I add margin to ".name" then why image moves. I've given border to all elements ("for reference"). Why is this happening?
body{
margin: 0;
padding: 0;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
font-size: 3.5vh;
background-color: #000;
}
.percy-image{
border: 2px solid red;
height: 60vh;
margin-left: 50vw;
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
}
.info{
display: inline-block;
border: 2px solid yellow;
color: white;
margin-top: 1vh;
}
.name{
border: 2px solid white;
margin-top: 20vh;
display: inline-block;
}
.role{
font-size: 1.8vh;
display: inline-block;
border: 2px solid white;
}
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="fusion.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fusion</title>
</head>
<body>
<div class="wrapper">
<div class="info">
<p class="name">I'M PERCY JACKSON</p>
<p class="role">WEB DEVELOPER</p>
<img src="man.jpg" alt="" class="percy-image">
</div>
</div>
</body>
</html>
This is the Image when Margin applied!
This is the Image when Margin no applied
Because Nothing is interrupting Image(no divs, no text, no elements).
Then Why its moving?