Edited - Although I have requested exclusively in css, I have seen that in fact the final result in JS is much more professional and lean. Being so I confirmed @renan's response as the one that really helped. However I would stress here that @Fetz's response was really the best output to use CSS in this case. However the final effect is ugly, moving the entire page of place.
My question is simple. I have used :hover
heavily in CSS and it has served me to some extent.
However, I have wanted something different. I wanted to be able to click on a div
so that it would increase in size, and that I would have to click on it in a specific corner to decrease it.
The hover
is part of the process, but when you hover the mouse from div
it returns to the previous size.
What I want is for div
to only change when I click on it. And if possible it will only return to its original form if I click on a X
for example or outside the div
in question.
I've tried a lot, I've found some things in JS, but I'm doing my best not to use JS in my project. So I started to imagine that with PHP this is possible. Or some CSS keyword to put in stylesheet
instead of hover
.
Do you have any words reserved for this like a possible onmouseclick
of life?
Thank you in advance.
#atredit{
position:absolute;
width: 150px;
height: 75px;
background-color: #F5F5F5;
border: 1px solid #111111;
border-radius: 5px;
margin-top: 150px;
margin-left: 200px;
overflow: hidden;
cursor:pointer;
}
#atredit:hover{
width: 150px;
height: 300px;
transition: 0.5s ease-in-out;
}