I want to create a button in html. When i click, it should go inner side and if i click it again it should come up. How to do it in CSS?
THanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t achieve that using CSS alone.
You would need to use Javascript to update a boolean variable that holds the state of the button: pressed or released and change the css class of the element accordingly.
See for instance this jQuery UI demo or the How do you create a toggle button? question on SO.