I am currently in the process of creating a dropdown menu for my website. As someone who is new to web design and still learning the ropes, I am pleased with the progress I have made so far.
Here is the HTML code I am using:
<ul><li>Home</li>
<li>About</li>
<li>
Portfolio
<ul>
<li>Web Design</li>
<li>Web Development</li>
<li>Illustrations</li>
</ul>
</li>
<li>Blog</li>
<li>Contact</li>
</ul>
And here is the corresponding CSS code:
ul {
text-align: left;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
}
ul li {
font: bold 12px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 20px;
background: #fff;
cursor: pointer;
}
ul li:hover {
background: #555;
color: #fff;
}
ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
width: 150px;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
}
ul li ul li {
background: #555;
display: block;
color: #fff;
}
ul li ul li:hover
{
background: #666;
}
ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
I am looking to add a new list item to the existing <li>Web Design</li>
. If anyone could provide guidance on how to achieve this and create a submenu that appears on the right side when hovering over "Web Design," I would greatly appreciate it. Thank you very much in advance.