I'm assuming that the empty space represents a div element, with some room on the right side. Based on what I see in the screenshot, I'm trying to move the Bars-Icon to the right corner of the div, at the top, and have the ul list below it. However, I've been playing around with it for about an hour and can't seem to get it right. Thank you in advance for any help!
Here is the HTML code:
<div><i class="fa-solid fa-bars fa-3x">
<div class="container-navmenu">
<ul>
<li><a href="https://www.playrealm.de/home">Home</a></li>
<li><a href="https://www.playrealm.de/wiki">Wiki</a></li>
<li><a href="https://www.playrealm.de/shop">Shop</a></li>
<li><a href="https://www.playrealm.de/team">Team</a></li>
<li><a href="https://www.playrealm.de/news">News</a></li>
<li><a href="https://www.playrealm.de/contact">Contact us</a></li>
</ul>
</div>
</i>
</div>
And here is the stylesheet being used:
.fa-bars{
color: white;
float: right;
}
.fa-bars:hover{
color: rgba(161,51,255,1.00);
}
.fa-bars:hover ul{
display: block;
}
.container-navmenu{
margin-right: 200px;
margin-top: 50px;
float:right;
text-align: right;
}
.container-navmenu ul{
display: block;
position: absolute;
background-color: #262F3D;
border-radius: 20px;
float: right;
}
.container-navmenu ul li{
list-style: none;
position: relative;
}
.container-navmenu ul li a{
font-family: "forma-djr-display", sans-serif;
font-weight: 800;
font-size: 20px;
color: white;
text-decoration: none;
padding: 10px;
display: block;
transition: all 0.3s ease 0s;
}
.container-navmenu ul li a:hover{
color: rgba(161,51,255,1.00)
}
I've tried adjusting margins and padding, but the Icon remains connected to the List, so changing their relative positions doesn't work.
I also attempted ending the </i>
right after the icon without including the List, but then I couldn't figure out how to display the List on hover using
.fa-bars:hover.container-navmanu ul{display:block}
.