Create a moving button using the position property?!


#1

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:

Thanks!
Mo

https://www.codecademy.com/courses/make-a-website/lessons/boundaries-space/exercises/position?action=lesson_resume



Replace this line with your code. 



#2

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."


#3

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