Skip to main content

Sliding navigation with single image

Simplicity is the best tool and we know it. So this tutorial is all about a simple and very effective navigation bar. This tutorial is all about CSS. There is no jquery or javascript and still it has very great effects.
For proffesional users who want simplicity and give more prefrence to their content rather than effects can go with that one.
We all know more effects take more time to load the page. Here is the solution. This tutorial contains a single image which slides as you move your mouse cursor. Simple lines of html code and small amount of css code is required to do this. Here we go......

Download Code


Html Code:

<ul class="green">
 <li><a href="#" title="home" class="current"><span>home</span></a></li>
    <li><a href="#" title="products"><span>products</span></a></li>
    <li><a href="#" title="blog"><span>blog</span></a></li>
    <li><a href="#" title="contact"><span>contact</span></a></li>
</ul>

<ul class="blue">
 <li><a href="#" title="home" class="current"><span>home</span></a></li>
    <li><a href="#" title="products"><span>products</span></a></li>
    <li><a href="#" title="blog"><span>blog</span></a></li>
    <li><a href="#" title="contact"><span>contact</span></a></li>
</ul>

Screen Shot:



Css Code:

Css for unordered list and its position is:
ul {
 padding: 5px;
 margin: 10px 0;
 list-style: none;
 background-color: #fff;
 border-bottom: 1px solid #e7e7e7;
 float: left;
 clear: left;
}

ul li {
 float: left;
 display: inline; /*For ignore double margin in IE6*/
 margin: 0 10px;
}

ul li a {
 text-decoration: none;
 float:left;
 color: #999;
 cursor: pointer;
 font: 900 14px/22px "Arial", Helvetica, sans-serif;
}

ul li a span {
 margin: 0 10px 0 -10px;
 padding: 1px 8px 5px 18px;
 position: relative; /*To fix IE6 problem (not displaying)*/
 float:left;
}

Css for navigation and its hover effects are here :

ul.red li a:hover {
  color: #fff;
 background: url(images/red.png) no-repeat top right;
}

ul.red li a:hover span {
 background: url(images/red.png) no-repeat top left;
}

ul.red li a.current {
 background: url(images/red.png) no-repeat top right;
  color: #fff;
}

ul.red li a.current span {
 background: url(images/red.png) no-repeat top left;
}
Hope you will like this post.

Comments

Popular posts from this blog

Network Topologies (Tutorial-4)

Topology refers to the way in which the network of computers is connected. The choice of topology is dependent upon--- Type and number of equipment being used  Planned applications and rate of data transfers  Required response times  Cost Types of Network Topologies Physical Topology: Physical topology defines how devices are connected to the network through the actual cables that transmit data(physical structure of the network)  Logical Topology: Logical Topology (also referred to as Signal Topology) is a network computing term used to describe the arrangement of devices on a network and how they communicate with one another.

Cisco Hierarchical Model

Cisco Hierarchical Model Defined by Cisco to simplify the design, implementation, and maintenance of responsive, scalable, reliable, and cost-effective networks. The 3 layers are logical and not physical – there may be many devices in a single layer, or a single device may perform the functions of 2 layers, eg: core and distribution. The Cisco Hierarchical Model

Eden: PHP Library To Get Things Easy For PHP Developer

Eden is PHP Library designed for helping developers in their rapid development work. In Our most of the project we have to integrate our developed website or application with most of  the social networking websites like Google, Facebook, Twitter, yahoo etc. so what we do is we integrate libraries of different websites differently Although We could make the code reusable but still if the websites increases then confusion will also increases. Adding different libraries form different sources add more complexity to your project and ends up to be hard to maintain. Eden simply a set of reusable components, that works with any PHP framework and CMS. Eden makes code logical and readable with dead simple syntax. Eden Will work With Most Of Web services including Amazon Web service Facebook Foursquare Google twitter tumbler Paypal Yahoo You could Download the File From  Eden Official Website  and Can use this will just a simply including this...