Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
How can we increase size of button when click (only for click time), & image when mouse over.
Posted
Updated 20-Nov-20 11:18am

hi use css like:

<style>
.test
{
width: 30px;
height: 25px;
background-color: Gray;
}
.test:focus
{
width: 50px;
height: 45px;
background-color: Silver;
}
</style>
<input type="button" value="Hello" class="test" />
 
Share this answer
 
HTML CODE


img id="imgId" src="" onmouseover="javascript:funMouseOver(this);">

//script code


function funClick()
{
// if u want to increase width
this.style.width="200";
// if u want to increase height
this.style.height="200";
}

function funMouseOver()
{
// if u want to increase width,give pixels according to ur requirement
this.style.width="200";
// if u want to increase height
this.style.height="200";
}
 
Share this answer
 
CSS
.button {
  transition: ease-in-out all 0.1s;
  transform: scale(1);
}

.button:active {
  transform: scale(1.2);
}


HTML
<button class='.button'>test</button>


it's not perfect, but it's the best u can do with css nowdays
 
Share this answer
 
Comments
Richard Deeming 24-Nov-20 2:29am    
Your solution would not work with any browser which was available when this question was asked.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900