Sunday, February 21, 2021

Pure HTML and CSS Navigation Bar

 A simple navigational menu using pure HTML and CSS.

 I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

style.css

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
background: #F9F9F9;
font-size:22px;
color: #000000;
    font-family: "Calibri", sans-serif;
}

.container {
    display: block;
    padding: 100px 0 0;
}

.content {
    display: block;
    text-align: center;
}

h1 {
font-size: 50px;
    font-family: "Calibri", sans-serif;
    line-height: 1.5;
}

p {
    margin: 0 0 50px;
}

nav {
    width: 750px;
    margin: auto;
}

nav ul {
list-style: none;
position: relative;
    display: flex;
    margin: 0;
    padding-left: 0;
}
nav ul li {
background-color: #0E4D90;
    text-align: center;
    width: 150px;
    margin: 0;
    padding: 0;
}

nav a {
display:block;
color:#FFF;
font-size:20px;
line-height: 60px;
text-decoration:none;
}

nav a:hover { 
background-color: #115CAD; 
}

nav ul ul {
display: none;
position: absolute; 
top: 60px;
    left: 0;
}
nav ul li:hover > ul {
display:inherit;
}
nav ul ul li {
width:150px;
float:none;
display:list-item;
position: relative;
}

nav ul ul ul li {
position: relative;
top:-60px; 
left:150px;
}

ul li ul li > a:after {
    position: absolute;
    content:  ' \27A7';
    right: 12px;
}
li > a:only-child:after {
    content: '';
}


index.html

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Pure CSS Navigation Bar</title>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <div class="container">
            <div class="content">
                <h1>Pure HTML and CSS Navigation Bar</h1>
                <h2>Mr. Jake R. Pomperada, MAED-IT, MIT</h2>
<p>A simple dropdown navigation menu made with CSS Only.</p>
            </div>

            <nav>
                <ul class="dropdown">
                    <li>
                        <a href="#">Menu Item</a>
                        <ul>
                            <li><a href="#">Item 1</a></li>
                            <li><a href="#">Item 2</a></li>
                            <li>
                                <a href="#">Item 3</a>
                                <ul>
                                    <li><a href="#">Item 6</a></li>
                                    <li><a href="#">Item 7</a></li>
                                    <li><a href="#">Item 8</a></li>
                                    <li><a href="#">Item 9</a></li>
                                    <li><a href="#">Item 10</a></li>
                                </ul>
                            </li>
                            <li><a href="#">Item 4</a></li>
                            <li><a href="#">Item 5</a></li>
                        </ul>        
                    </li>
                    <li><a href="#">Menu Item</a></li>
                    <li><a href="#">Menu Item</a></li>
                    <li><a href="#">Menu Item</a></li>
                    <li><a href="#">Menu Item</a></li>
                </ul>
            </nav>
        </div>
    </body>
</html>


No comments:

Post a Comment