Blogger Navigation bar Code
How to Create Navigation Bar ?
Here's an example code snippet for a navigation bar using HTML and CSS:
HTML:
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li>
<a href="#">Products</a>
<ul>
<li><a href="#">Product 1</a></li>
<li><a href="#">Product 2</a></li>
<li><a href="#">Product 3</a></li>
</ul>
</li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
CSS:
<style>
nav {
background-color: #333;
height: 50px;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
}
li {
float: left;
height: 100%;
position: relative; /* Add this line to position sub-menu correctly */
}
a {
display: block;
color: white;
text-align: center;
padding: 16px;
text-decoration: none;
}
a:hover {
background-color: #111;
}
/* sub-menu styles */
ul ul {
display: none;
position: absolute;
top: 50px;
left: 0;
background-color: #333;
width: 200px;
}
ul li:hover > ul {
display: block;
}
ul ul li {
float: none;
position: relative;
}
ul ul ul {
position: absolute;
left: 200px;
top: 0;
}
</style>
Other for blogger:
<b:includable>
<b:widget>
<b:widget id='Navbar1' locked='false' title='Navbar' type='Navbar' version='2' visible='true'>
<b:includable id='main'><script type="text/javascript">
function setAttributeOnload(object, attribute, val) {
if (window.addEventListener) {
window.addEventListener('load', function () { object[attribute] = val; }, false);
} else {
window.attachEvent('onload', function () { object[attribute] = val; });
}
}
</script>
<div id="navbar-iframe-container"></div>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script type="text/javascript">
gapi.load('gapi.iframes:gapi.iframes.style.bubble', function () {
if (gapi.iframes && gapi.iframes.getContext) {
gapi.iframes.getContext().openChild({
url: 'https://www.blogger.com,
where: document.getElementById('navbar-iframe-container'),
id: 'navbar-iframe'
});
}
});
</script>
<script type="text/javascript">
(function () {
var script = document.createElement('script');
script.type = 'text/javascript';
var head = document.getElementsByTagName('head')[0];
if (head) {
head.appendChild(script);
}
})();
</script>
</b:includable>
</b:widget>
</b:widget>
</b:includable>
</b:section>
</div>
<div class='clearfix' />
</div>
</div>
<div class='clearfix' />
Comments
Post a Comment
Thanks for your Comments.