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.

DIV height change ease on hover

Featured Replies

Okay basically I want a div to change height on hover and text to fade in, onmouse out i want the text to fade out and the div to ease out to its original height, how would i do this? can i do this purely using css or do you have to intergrate something else? heres the css and html..

 

 

FORGOT TO MENTION:

 

 

The div I won't to change on hover is "Description" ignore the other hover styles they aren't what I am talking about. my bad!

 

CSS

 

#body1container {
width:300px;
height:250px;
background:rgba(50,84,28,0.7);
-moz-border-radius: 5px;
border-radius: 5px;
float:left;
margin-left:0px;
margin-right:40px;
}
#body1 {
width:280px;
height:230px;
background-image:url(designbgbw.jpg);
-moz-border-radius: 5px;
border-radius: 5px;
float:left;
margin-left:10px;
margin-right:10px;
margin-top:10px;
margin-bottom:10px;
}
#body1:hover {
width:280px;
height:230px;
background-image:url(designbg.jpg);
-moz-border-radius: 5px;
border-radius: 5px;
float:left;
margin-left:10px;
margin-right:10px;
margin-top:10px;
margin-bottom:10px;
cursor:pointer;
}
#body1textbg {
width:270px;
height:auto;
background:rgba(50,84,28,0.9);
-moz-border-radius: 5px;
border-radius: 5px;
text-align:left;
float:left;
margin-left:5px;
margin-top:5px;
}
#description {
width:270px;
height:13px;
background:rgba(50,84,28,0.9);
-moz-border-radius: 5px;
border-radius: 5px;
text-align:left;
float:left;
margin-left:5px;
margin-top:5px;
}

 

 

HTML

 

<div id="mainbody"> <!-- START MAIN BODY -->
<div id="body1container">
<div id="body1">
<div id="body1textbg"><h3> Services.</h3>
</div>
<div id="description">
</div>
</div>
</div> <!-- END MAIN BODY -->

 

 

Any kind of help will be appreciated, thanks!

Edited by Willows

You'd need Javascript and JQuery for something like that.

 

Also, look into CSS3 animations. I've never used them so I can't confirm if they're what you're looking for, but I do know that you'd be better off with JQuery.

Edited by Pete Prosper

  • Author

You'd need Javascript and JQuery for something like that.

 

Also, look into CSS3 animations. I've never used them so I can't confirm if they're what you're looking for, but I do know that you'd be better off with JQuery.

 

Cool ill check it out!

  • Author

You can do it quite easily in css.

 

If you want to support older browsers you'll need to use jquery .animate() or something, though.

 

~evu.

 

Thats great thanks

 

Thread title amended.

Please don;t use all caps, it's considered shouting and rude.

 

Sorry pal!

Create an account or sign in to comment

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.