Create a moving button using the position property?!


Hi everyone!
I am simply curious about how to make this tip work? Code Academy gives us the following little tip stating

“Ever click a button on a webpage that seemed to move down and then back up like a real-life button? We can implement this trick using the position property.”

How do I do this?! whats the code? :slight_smile:


Replace this line with your code. 


It’s caused by the position change under the active selector in the CSS. The code is in the instructions:

"Add the following CSS to the .contact-btn a:active selector:

top: 2px;

This will cause the Contact button to move down slightly while being clicked, simulating a real-life button being pushed."


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.