Whenever I hover over the #HoverMe div
, a hidden #hidden
div appears, and when I unhover it, the hidden div disappears again. The #hidden
div contains a sub-div that functions like a dropdown list. The #hidden
div is styled with position: absolute;
. How can I ensure that the #hidden
div shows up next to the #HoverMe
div, with its sub-div (inside the hidden div) appearing underneath?
Current Layout:
------------
| #HoverMe |
------------
---------
| #hidden |
| --------|
| car.name|
|---------|
| car.name|
---------
Desired Layout:
------------ ---------
| #HoverMe | | #hidden |
------------ | --------|
| car.name|
|---------|
| car.name|
---------
Code Snippet:
I am using my #HoverMe
-div to display the #hidden
-div, which contains a list of content I want to show.
<div style="position: relative">
<div id="HoverMe" >
This owner owns @Html.DisplayFor(model => model.TotCar) cars in total
</div>
<div id="hidden" style="position: absolute; background-color: black"> //<------- hidden
@foreach (var car in Model.Car) {
<div>@car.Name</div>
}
</div>
</div>