nitan nitan - 2 years ago 105
HTML Question

Hover moving other elements to the right

Whenever my mouse hovers to one of the long

elements the other elements move to the right.

Here's the fiddle link :



footer .ourServices{

display: inline-block;
margin: 0px -10px 0px 77px;


footer .ourServices ul li,a,h3{
text-decoration: none;
list-style: none;

footer .ourServices .columns_title{
text-transform: uppercase

footer .ourServices .columns_title{
footer .ourServices ul li, h3{

footer .ourServices ul li{
margin-top: 10px;

footer ul li:hover{
font-family: 'Open Sans';


<div class="footer_links">
<div class="ourServices">
<h3 class="columns_title">Connect</h3>
<li>1234 Street Name</li>
<li>Suburb Title</li>
<li>State, Australia 400</li>
<li>Phone:(00) 000 000 000</li>
<li>fax:(00) 000 000 000</li>

<div class="ourServices">
<h3 class="columns_title">Our Services</h3>
<li><a href="#">Cotmprehensive geriatric assessment</a></li>
<li><a href="#">Falls, mobility problems</a></li>
<li><a href="#">Incontinence</a></li>
<li><a href="#">Polypharmacy</a></li>
<li><a href="#">Osteoporosis</a></li>
<li><a href="#">Frailty</a></li>

<div class="ourServices">
<h3 class="columns_title">Explore</h3>
<li><a href="#">Our Doctors</a></li>
<li><a href="#">Treatments</a></li>
<li><a href="#">Appointments</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>

Answer Source

It is because the width of each div is being determined by the width of its contents, and the positioning of the other div is determined by the positioning of the div beside it. The bold hover effect is causing the text within to get wider, which is causing a chain reaction in the positioning of the other elements.

To fix it, set the width of the container so that it won't resize based on its contents:

footer .ourServices {
    width: 170px;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download