Ajax Loader
HTML
<!DOCTYPE html>
1
<!DOCTYPE html>
2
<html lang="ru">
3
  <head>
4
    <meta charset="utf-8">
5
    <title>Drop-down menu</title>
6
  </head>
7
  <body>
8
    <div id="wrapper">
9
      <nav>
10
        <ul class="menu">
11
          <li class="home current"><a href="#"><span>Home</span></a></li>
12
          <li><a href="#"><span>About</span></a></li>
13
          <li><a href="#"><span>Service</span></a>
14
            <ul class="sub-menu">
15
              <li><a href="#">Sub-menu 1</a></li>
16
              <li><a href="#">Sub-menu 2</a></li>
17
              <li><a href="#">Sub-menu 3</a></li>
18
            </ul>
19
          </li>
20
          <li><a href="#"><span>Application Form</span></a></li>
21
          <li><a href="#"><span>Blog</span></a></li>
22
          <li><a href="#"><span>Contacts</span></a></li>
23
        </ul>
24
      </nav>
25
    </div>
26
  </body>
27
</html>
 
CSS
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700);
1
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700);
2
 
3
#wrapper {
4
  margin: 10px;
5
}
6
 
7
/* BEGIN: Общие стили */
8
.menu,
9
.sub-menu {
10
  list-style-type: none;
11
  margin: 0;
12
  padding: 0;
13
}
14
 
15
.menu li {
16
  background-color: #3E454D;
17
  cursor: pointer;
18
  position: relative;
19
  transition: background-color .5s;
20
  -moz-transition: background-color .5s;
21
  -o-transition: background-color .5s;
22
  -webkit-transition: background-color .5s;
23
  /* IE lt 10, Chrome lt 1, Opera lt 11.6, Safari lt 3, FF lt 4, Android lt 2.1 и iOS lt 2.0 не поддерэивают transition. */
24
}
25
 
26
.menu li:hover {
27
  background-color: #353B41 !important; /* .menu > li.home может иметь больше приоритета. Поэтому. */
28
}
29
 
30
.menu a {
31
  color: #FFF;
32
  display: block;
33
  font-family: 'Open Sans', sans-serif;
34
  font-size: 14px;
35
  height: 100%;
36
  margin: 0 5px;
37
  overflow: hidden;
38
  position: relative;
39
  text-align: center;
40
  text-decoration: none;
41
  text-transform: uppercase;
42
  word-wrap: break-word;
43
}
44
 
45
.menu a:hover {
46
  /* Защита от простого a:hover. */
47
  color: #FFF;
48
}
49
/* END: Общие стили */
50
 
51
/* BEGIN: Главное меню */
52
.menu {
53
  /* Рекомендуется задать высоту главного меню именно отсюда. */
54
  height: 90px;
55
}
56
 
57
.menu > li {
58
  float: left;
59
  height: 100%;
60
  width: 15%; /* Мудакам которые не поддерживают calc. */
61
  width: calc((100% - 90px) / 5);
62
  width: -moz-calc((100% - 90px) / 5);
63
  width: -webkit-calc((100% - 90px) / 5);
64
  /* IE lt 9, Chrome lt 19, Opera lt 15, Safari lt 6, FF lt 4, Android и iOS не поддерэивают calc. */
65
}
66
 
67
.menu > li.home {
68
  background: #3E454D url(http://s26.postimg.org/qbf4q4j9h/home.png) center no-repeat;
69
  width: 90px;
70
}
71
 
72
.menu > li.current {
73
  background-color: #F2762E !important; /* !important VS .menu li:hover */
74
  box-shadow: none !important;
75
  -moz-box-shadow: none !important;
76
  -webkit-box-shadow: none !important;
77
  /* IE lt 9, Chrome lt 1, Opera lt 10.5, Safari lt 3, FF lt 3.5, Android lt 2.1 и iOS lt 2.0 не поддерэивают box-shadow. */
78
}
79
 
80
.menu > li:not(:first-child) {
81
  box-shadow: inset 1px 0 0 0 #272B31, inset 2px 0 0 0 #434A52;
82
  -moz-box-shadow: inset 1px 0 0 0 #272B31, inset 2px 0 0 0 #434A52;
83
  -webkit-box-shadow: inset 1px 0 0 0 #272B31, inset 2px 0 0 0 #434A52;
84
}
85
 
86
.menu > li.home > a {
87
  color: transparent !important;
88
}
89
 
90
.menu > li > a > span {
91
  left: 0; /* Селектор .menu a выравнивает содержимое по центру, из-за чего span начинается от центра. Исправляем. */
92
  position: absolute;
93
  right: 0;
94
  top: 50%;
95
  transform: translate(0, -50%);
96
  -ms-transform: translate(0, -50%);
97
  -moz-transform: translate(0, -50%);
98
  -o-transform: translate(0, -50%);
99
  -webkit-transform: translate(0, -50%);
100
  /* IE lt 9, Chrome lt 5, Opera lt 10.5, Safari lt 3.1, FF lt 3.5, Android lt 2.1 и iOS lt 2.0 не поддерэивают transform. */
101
}
102
/* END: Главное меню */
103
 
104
/* BEGIN: Подменю */
105
.sub-menu {
106
  max-height: 0;
107
  min-width: 100%;
108
  overflow: hidden;
109
  position: absolute;
110
  top: 100%;
111
  transition: max-height .5s .2s;
112
  -moz-transition: max-height .5s .2s;
113
  -o-transition: max-height .5s .2s;
114
  -webkit-transition: max-height .5s .2s;
115
}
116
 
117
li:hover > .sub-menu {
118
  max-height: 600px;
119
}
120
 
121
.sub-menu li {
122
  height: 60px;
123
}
124
 
125
.sub-menu a {
126
  line-height: 60px;
127
  transition: color .5s;
128
  -moz-transition: color .5s;
129
  -o-transition: color .5s;
130
  -webkit-transition: color .5s;
131
  white-space: nowrap;
132
}
133
 
134
.sub-menu li.current a,
135
.sub-menu a:hover {
136
  color: #F2762E !important; /* !important VS .menu a:hover */
137
}
138
/* END: Подменю */
 

Drop-down menu (limited)

CSSDeck G+