Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MORE-INFO HOVER EFFECT

Featured Replies

Hilariously creative, more information hover effect with CSS!!!

Searching for a cool hover effect to show up more information on your image or any div. You are at the right place.

 


 

Imagination is more important than knowledge. -Albert Einstein

Let us first imagine and make a hilreative blueprint of what we gonna make, and what we gonna need to do so.

 

Hilreative Blueprint

> A more info box that will be hidden initially and will show up on hover with our information.

> Now that can be done by translating the info box out of the container initially and by translating back it on hover.

 

Lets start with our HTML code.

 

<div class="container">
  <div class="moreInfoBox">
    <div class="category">CSS</div>
    <div class="moreInfo">Easiest way to make  3-D like buttons using CSS in just 3 steps!!!</div>
    <div class="author">By: Kumar Siddharth</div>
  </div>
</div>
    

 

Hilreative Trick

> Transformation VS Transition

Transformations are different form of animations which transforms(changes) the physical appearance of an element(viz. scaling,rotating,translating).
Whereas a transition property initiates any change applied on 'change of state'(viz. on click,on hover etc) and fill in between appearances of element all by itself.
.container{
  margin:5px auto;
 background:url('http://3.bp.blogspot.com/-B7ORnKMRdno/U6uhv-xUFxI/AAAAAAAAB10/4eCsO4Gct0U/s1600/3dbuttons.PNG');
  background-size:cover;
  background-repeat:no-repeat;
  border:solid 2px #3c404b;
  width:320px;
  height:231px;
  border-radius:5px;
  overflow:hidden;
}

.moreInfoBox{
  color:white;
  background:rgba(245,245,245,0.5);
  width:100%;
  height:100%;
  transform:translateX(-322px);
  transition:transform 1s ease-in-out;
  position:relative;
  font-size:25px;
}

Hilreative Trick

> How to center a div horizontally?

Give top and bottom margin as per your requirement but right and left,'auto' so that it will automatically adjust itself to the center.
Overflow is hidden to hide any element going out of 'container' div(its parent element).
Initially 'moreInfoBox' is translated out of the 'container' to left.

Background is given with opacity of '0.5' to show the context of information being shown.

Note: I have not used any kind of vendor prefixes for the sake of simplicity, do use them with your browsers,especially with the transformation and transition properties.
.category{
  padding:5px;
  background:#686868;
  transform:translateY(-45px);
  transition:transform 1s ease-in-out 1s;
}

.moreInfo{
  padding:5px;
  margin-top:20px;
  color:black;
}

.author{
  padding:5px;
  background:#EC5D93;
  position:absolute;
  bottom:0px;
  width:100%;
  box-sizing:border-box;
  transform:translateY(45px);
  transition:transform 1s ease-in-out 2s;
}

All the information in our info box has been styled now,name of the 'category' has been translated upwards and the 'author' downwards from their initial position which on hover will come back to their original position.
So finally lets do that Hilreative thing.

 

.container:hover .moreInfoBox,.container:hover .category, .container:hover .author{
  transform:translateX(0px);
}

 

On hovering over the container the info box along with information will come back to their original position via transition and transformation properties given to each element.

Yeah! you have made a hilariously creative div with more-info hover effect!!

do like our facebook page.

Edited by disissid

  • 3 months later...

Nice and simple 3d button but look good without hover effect.

 

I use this code on my website page and its work perfectly but I remove ugly hover effect ;)

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.