Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
526 views
in Technique[技术] by (71.8m points)

css - Make slide out up to icon img

I want to make icon img to slide out up any suggestions ? like social icons in this website : http://trydo.rainbowit.net/dark-portfolio-landing#portfolio

.move-left
{
  position: relative;
  transition: transform 0.3s ease;
  transform: translateX(0px);
}
.move-left img:hover {
  transform: translateY(-4px);
  cursor: pointer;


}
            <div class="move-left">
              <li class="nav-item"><a href="#"><img        src="facebook.svg" height="16px"></a></li>
            </div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I'm not sure why you intend to move the img when all of your transform and transition properties are on .move-left.

I've fixed your HTML as well as per @Paulie_D's comment.

.move-left {
  position: relative;
  transition: transform 0.3s ease;
  transform: translateX(0px);
}

ul {
  list-style: none;
}

.move-left:hover {
  transform: translateY(-4px);
  cursor: pointer;
}
<div class="move-left">
  <ul>
    <li class="nav-item">
      <a href="#"><img src="https://www.svgrepo.com/show/3885/facebook.svg" height="16px"></a>
    </li>
  </ul>
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...