While attempting to create my website, I encountered some challenges with the dropdown menu.
After following a tutorial on YouTube and making some modifications myself, there seems to be an issue. The screenshot below illustrates that it pulls down the rest of the navigation bar (Home and Contact Us), which was not my original intention.
https://i.sstatic.net/CwkpH.png
I have experimented with different solutions, but this is the closest I have gotten so far.
HTML
<div class="navigation">
<ul>
<li><a>☰</a>
<ul>
<li><a href="#">example1</a></li>
<li><a href="#">example2</a></li>
</ul>
</li>
<li><a href="index.html">Home</a></li>
<li><a href="contactpage.html">Contact us</a></li>
</ul>
</div>
CSS
.navigation ul{
width: 100%;
height: 25px;
margin: 0;
padding: 10px 120px;
background: rgba(53, 57, 53,0.9);
.navigation ul{
width: 100%;
height: 25px;
margin: 0;
padding: 10px 120px;
background: rgba(53, 57, 53,0.9);
.navigation ul li{
display: inline;
padding: 0px 10px 0px 0px;
list-style-type: none;
.navigation ul li a {
/*display: block;*/
padding: 10px 0px;
text-decoration: none;
color: #E5E4E2;
.navigation ul li ul {
display: none;
width: 130px;
background: rgba(53, 57, 53,0.9);
.navigation ul li:hover ul{
display: block;
.navigation ul li ul li {
float: left;
.navigation ul li ul li a{
padding: ;
.navigation ul li ul li a:hover {
color: #AFE1AF;
.navigation ul li a:hover{
color: #AFE1AF;