Reputation: 4353
I have the following simple HTML code:
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<style>
body {
padding: 30px;
}
a {
display: block;
}
a:hover {
transform: scale(2);
transition: all 4s;
}
</style>
</head>
<body>
<a href=#>Link</a>
</body>
</html>
in which the Link
is supposed to scale. However, it shifts to the left. What is the problem?
Upvotes: 3
Views: 53
Reputation: 2787
body {
padding:30px;
}
a {
display: inline-block;
transition: all 4s;
}
a:hover {
transform: scale(2);
}
<a href=#>Link</a>
You should have used display:inline-block to make it work. If it is what you are looking for, +1.
Upvotes: 4