I'm having an issue trying to create a dropdown menu with links on my website, but it doesn't seem to be working.
<!doctype html>
<html>
<head>
<style>
a.mainhrf ul.mainul
{
display: none;
}
a.mainhrf:hover ul.mainul
{
display: block;
}
a.mainhrf ul.mainul li
{
display: block;
}
</style>
</head>
<body>
<a class="mainhrf" href="#">Siemaza
<ul class="mainul">
<li><a href="#">A</a></li>
<li><a href="#">B</a></li>
</ul>
</a>
</body>
</html>
It seems that without an a
element inside the li
, the dropdown works fine.
<!doctype html>
<html>
<head>
<style>
a.mainhrf ul.mainul
{
display: none;
}
a.mainhrf:hover ul.mainul
{
display: block;
}
a.mainhrf ul.mainul li
{
display: block;
}
</style>
</head>
<body>
<a class="mainhrf" href="#">Siemaza
<ul class="mainul">
<li></li>
<li></li>
</ul>
</a>
</body>
</html>
I would greatly appreciate any help or suggestions you can provide! :)