How would I go about acheiving an effect similar to that on this site's portfolio page Solid Giant, with CSS and HTML?
I had thought that just putting something like this would work:
a img{
margin-top: 5px;
}
a img:hover{
margin-top: 0px;
}
But it did not work, even if I put the :hover on the link instead of the img. I scoured his code and css but I could not for the life of me figure this out. Help please :)
Also see translate():
http://www.w3schools.com/css/css3_2dtransforms.asp
See a similar working example:
http://jsfiddle.net/rimian/7aPvS/1/
Give the image an id:
position: relative
would work:note that
position: relative
reserves the space in the document flow as if the element were not moved. But I think in this case, that is not an issue.You could also use CSS/HTML5 animations: http://slides.html5rocks.com/#css-animation
you could also wrap it in another parentdiv that has position:relative set:
Make sure you have this in your html so IE knows how to work properly