Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8542835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:09:38+00:00 2026-06-11T12:09:38+00:00

I have the following HTML: <figure> <img src=http://lorempixel.com/200/200/ alt=> <figcaption>This is the caption</figcaption> </figure>

  • 0

I have the following HTML:

<figure>
  <img src="http://lorempixel.com/200/200/" alt="">
  <figcaption>This is the caption</figcaption>
</figure>

And the following CSS:

figure {
  background: #ddd;
  display: inline-block;
  height: 200px;
  margin: 50px;
  position: relative;
  width: 200px;
  vertical-align: top;
}
figure:hover img {
  box-shadow: 0 30px 20px -10px hsla(0,0%,0%,.25);
  transform: perspective(1000px) rotateX(45deg);
  transform-origin: 50% 0;
}
img {
  position: relative;
  transition: .2s;
  vertical-align: top;
  z-index: 10;
}
figcaption {
  bottom: 0;
  box-sizing: border-box;
  padding: 6px;
  position: absolute;
  text-align: center;
  width: 100%;
}

Here is a live example: http://codepen.io/joshnh/pen/FlvJr

Despite setting the transform-origin to the top of the image, it still moves down slightly when hovering. What is causing this, and how do I prevent it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:09:39+00:00Added an answer on June 11, 2026 at 12:09 pm

    Take a look: http://jsfiddle.net/cQphE/

    The problem was that you were transitioning, along with the transform property, the transform-origin. On hover it was going from the default 50% 50% to the 50% 0; you set.

    You have this:

    img {
      transition: 0.2s;
    }
    
    figure:hover img {
      box-shadow: 0 30px 20px -10px hsla(0,0%,0%,.25);
      transform: perspective(1000px) rotateX(45deg);
      transform-origin: 50% 0;
    }
    

    Which is the same as having this:

    img {
      box-shadow: none;
      transform: perspective(0) rotateX(0);
      transform-origin: 50% 50%;
      transition: 0.2s;
    }
    
    figure:hover img {
      box-shadow: 0 30px 20px -10px hsla(0,0%,0%,.25);
      transform: perspective(1000px) rotateX(45deg);
      transform-origin: 50% 0;
    }
    

    What you should have is this:

    img {
      transform-origin: 50% 0;
      transition: 0.2s;
    }
    
    figure:hover img {
      box-shadow: 0 30px 20px -10px hsla(0,0%,0%,.25);
      transform: perspective(1000px) rotateX(45deg);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html and css. But what I can't figure out is
I have following HTML <tr id=r1 class=l1> <td><img class=plusminus id=r1c1 src=assets/images/plus.png border=0 />3/10/12</td> <td></td>
I have an HTML file which contains the following line: <div><img src=img1.gif><br>My Text</div> I'm
I have the following HTML: <div id=wrapper> <div class=p1> <a href=# class=quickFlipCta><img src=Test Pictures/QuestionMark.gif
I have the following razor template html, although I can't figure out how to
I have the following html and css code: <!DOCTYPE HTML> <html> <head> </head> <body>
I have the following HTML code with CSS: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
I have this following code: $(.preview).find(#panel).each(function(i, val) { var x = + $(val).html(); $(x).find(.dmPageHeadline).prepend(
I have the following CSS code for my HTML table, but for some reason
Given the following HTML: <ul> <li class=imgThumbLi> <img src=larry.jpg/> </li> <li class=imgThumbLi> <img src=curly.jpg/>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.