Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

My cursor doesn't move to drop down sub items

anuraa

Legendary Coder
Hello friends:

there is dropdown items under "About Us" and "Services". When I move the cursor to either "About Us" or "Services", it shows the sib items under it. Once, I tries to move the cursor to subitems, it disappears. Thanks for your helps.






HTML:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Drop down Menu </title>
    <style>
        *
{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body{
    background-image: url(background.jpg);
    background-size: cover;
    background-position: center;
    font-family: sans-serif;
}
.menu-bar{
    background:rgb(0, 100, 0);
    text-align: center;

}
.menu-bar ul{
    display: inline-flex;
    list-style: none;
    color: #fff;
}
.menu-bar ul li{
    width: 120px;
    margin: 15px;
    padding: 15x;
}
.menu-bar ul li a{
    text-decoration: none;
    color: #fff;
}
.active, .menu-bar ul li:hover{
    background-color: #2bab0d;
    border-radius: 3px;
}
.menu-bar .fa{
    margin: 8px;
}

.sub-menu-1{
    display: none;
}
.menu-bar ul li:hover .sub-menu-1{
    display: block;
    position: absolute;
    background: rgb(0, 100, 0);
    margin-top: 15px;
    margin-left: -15px;
}
.menu-bar ul li:hover .sub-menu-1 ul{
    display: block;
    margin: 10px;
}
.menu-bar ul li:hover .sub-menu-1 ul li{
    width: 150px;
    padding: 10px;
    border-bottom: 1px dotted #fff;
    background: transparent;
    border-radius: 0;
    text-align: left;
}
.menu-bar ul li:hover .sub-menu-1 ul li:last-child{
    border-bottom: none;
}
.menu-bar ul li:hover .sub-menu-1 ul li a:hover{
    color: #b2ff00;

}
.fa-angle-right{
    float:right;
}
.sub-menu-2{
    display: none;
}
.hover-me:hover .sub-menu-2{
    position: absolute;
    display: block;
    margin-top: -40px;
    margin-left: 140px;
    background: rgb(0, 10, 0);
}
    </style>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
    <div class="menu-bar">
    <ul>
        <li class="active"><a href="#"><i class="fa fa-home"></i>Home</a></li>
        <li><a href="#"><i class="fa fa-user"></i>About Us</a>
        <div class="sub-menu-1">
            <ul>
                <li><a href="#">Mission</a></li>
                <li><a href="#">Vision</a></li>
                <li><a href="#">Team</a></li>
            </ul>
        </div>
        </li>
        <li><a href="#"><i class="fa fa-clone"></i>Services</a>
            <div class="sub-menu-1">
                <ul>
                    <li><a href="#">Web design</a></li>
                    <li class="hover-me"><a href="#">Marketing</a><i class="fa fa-angle-right"></i>
                    <div class="sub-menu-2">
                        <ul>
                        <li><a href="#">SEO</a></li>
                        <li><a href="#">Social Media</a></li>
                        <li><a href="#">Email Marketing</a></li>
                        </ul>
                    </div>
                    </li>
                    <li class="hover-me"><a href="#">Mobile App</a><i class="fa fa-angle-right"></i></li>
                </ul>
            </div>
            </li>
        </li>
        <li><a href="#"><i class="fa fa-users"></i>Clients</a></li>
        <li><a href="#"><i class="fa fa-angellist"></i>Investors</a></li>
    </ul>
    </div>   
</body>
</html>
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom