I have elements(divs) in jquery that have display none. They are still given space in the fitting. I now I can filter them out, but that seems to have other consequences
I guess it would help to state what I am attempting to do. I want to display an alternative div on hover. This works except for the space given to the
display: none
divs
on hover
here is my code if it helps
html
<div id="item-container">
@for (int i = 0; i < 20; i++)
{
<div class="item">@i</div>
<div class="secondary">@i test</div>
}
</div>
css
#item-container .item {
height: 40px;
width: 40px;
border: 1px solid red;
background-color: grey;
}
#item-container .item:hover {
z-index: 0;
}
#item-container .item:hover + .secondary {
display: block !important;
z-index: 1;
margin-left: -11.2%;
}
#item-container .secondary {
height: 40px;
width: 40px;
border: 1px solid blue;
background-color: yellow;
display: none;
}