Sunday, November 23, 2014

css navigation bar

css navigation bar

CSS code

one of my useful and simple css navigation menu bar I always use, only change the style color and use it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<style>
.horizontal-nav {
    width:100%;
    height:30px;
    padding: 0px;
    margin-bottom: 10px;
}
 
.horizontal-nav ul {
    margin: 0px;
    padding: 0px;
    float: left;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #727272;
    background-image: -moz-linear-gradient(center bottom , #404040 0%, #5F5F5F 100%);
}
 
.horizontal-nav ul li {
    display: table-cell;
    float: left;
    margin: 0px;
    padding: 0px;
    border-left: 1px solid #727272;
}
 
.horizontal-nav ul li:first-child {
  border-left: 0 none;
}
 
.horizontal-nav ul li a {
    display: block;
    padding: 5px 30px;
    color: #fff;
    font: bold 12px Arial,Tahoma,Helvetica,sans-serif;
    text-decoration: none;
    border-top: 1px solid rgba(255,255,255, 0.25);
    border-left: 1px solid rgba(255,255,255, 0.25);
}
 
.horizontal-nav ul li:first-child a {
  border-left: 0 none;
}
 
.horizontal-nav ul li a:hover {
  background: #282828;
}
 
.horizontal-nav-a-selected {
  background: #282828;
}
 
.horizontal-nav ul li:first-child a {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}
 
.horizontal-nav ul li:last-child a {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}
 
.horizontal-nav ul li a img {
    margin-right:10px;
}
</style>


HTML code

simple adding class="horizontal-nav-a-selected" to the <a> object of the selected item.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<H2>simple css navigation bar</H2>
<div class="horizontal-nav">
  <ul>
    <li><a href="#"><IMG SRC="http://img1.blogblog.com/img/icon18_wrench_allbkg.png"
    WIDTH="16" HEIGHT="16"  BORDER="0" ALT="">Menu 1</a></li>
    <li><a class="horizontal-nav-a-selected" href="#">
    <IMG SRC="http://img2.blogblog.com/img/icon18_edit_allbkg.gif"
    WIDTH="16" HEIGHT="16"  BORDER="0" ALT="">Menu 2</a></li>
    <li><a href="#"><IMG SRC="http://fcgadgets.appspot.com/images/facebook.gif"
    WIDTH="16" HEIGHT="16"  BORDER="0" ALT="">Menu 3</a></li>
    <li><a href="#"><IMG SRC="http://fcgadgets.appspot.com/images/information.png"
    WIDTH="16" HEIGHT="16"  BORDER="0" ALT="">Menu 4</a></li>
    <li><a href="#"><IMG SRC="https://www.blogger.com/img/cmt/close.gif"
    WIDTH="16" HEIGHT="16" BORDER="0" ALT="">Menu 5</a></li>
  </ul>
</div>


Share it

Online Marketing