aid

Sunday, 17 August 2014

how to create dropdown menu in css

how to create dropdown menu in css.

below is the example of drop-down menu in css.

<!DOCTYPE html>
<html lang="en">
<head>
<title>Example of simple drop down menu</title>
<style type="text/css">
    ul {
        padding: 0;
        list-style: none;
    }
    ul li {
        width: 100px;
        text-align: center;
        background: #2D76B7;
        font-weight: bold;
        border-radius: 10px;
    }
    ul li a{
        padding: 5px;
        display: block;
        color: #ffffff;
        text-decoration: none;
    }
    ul li a:hover {
        text-decoration: underline;
    }
    ul li ul {
        display: none;
    }
    ul li:hover ul {
        display: block;
    }
</style>
</head>
<body>
    <h1>A Simple Drop Down Menu</h1>
    <ul>
        <li><a href="#">Click Me</a>
            <ul>
                <li><a href="#">child 1</a></li>
                <li><a href="#">child 2</a></li>
                <li><a href="#">child 3</a></li>
            </ul>
        </li>
    </ul>
</body>
</html>                                         

No comments:

Post a Comment