- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Moving objects horizontally</title>
<meta charset="utf-8">
<link rel="stylesheet" href="world.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="world">
<div class="wizard"></div>
<div class="tree"></div>
</div>
</body>
</html>
CSS
.wizard {
top: 244px;
left: 30px;
}
.tree {
top: 178px;
left: 400px;
}
You’ve gone to a different page
Goalscompleted
0
- Add a
transform
property with the valuetranslateX(250px)
to the.wizard
block, and move the magician to the right. - And then turn him back by adding another movement property to the transform property:
transform: translateX(250px) translateX(-250px);
.
Comments