/    Sign up×
Community /Pin to ProfileBookmark

Change div size on hover

Good morning everybody,
I’m creating a website and I can’t understand if it’s possible to change a div size simply on hover over another div.
In this page I have a menu with different elements and I’d like to resize the transparent box depending on the element selected. For example, I’d like to mantain the same dimension for all the elements except for the last (blue), that increase the box dimension from 250px to 350px.
This is the main HTML code:


<div class=”menu_main”>
<ul class=”menu slide”>
<li><a href=”….” class=”orange”>NAME2</a></li>
<li><a href=”….” class=”blue”>NAME1</a></li>
….
</ul>
<div class=”box”></div>
</div>

And the CSS code is:

…..

.menu_main {
float:left;
font:normal bold 11px/35px verdana, sans-serif;
overflow:hidden;
position:relative;
left:50px;
}

.menu_main .box {
-moz-transition-duration:.4s;
-o-transition-duration:.4s;
-webkit-transition-duration:.4s;
background-color:rgba(255, 250, 250, 0.5);
height:0;
width:900px;
}
.menu_main:hover div.box {
height:250px;
}


….

.ul.menu li a.blue:hover,ul.menu li:hover a.blue {
background:#c00;

}

….

Thank you very much for your attention. I hope I have been clear

to post a comment
CSS

0Be the first to comment 😎

×

Success!

Help @merkb24 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...