Today I have covered ps and fixed a navigation bar on the top. I will give a layout below. I will use position: fixed [html] & lt ;! DOCTYPEhtmlPUBLIC & quot;-// W3C // DTDXHTML1.0Transitional // EN & quot; http://www.w3.org/
Today, I have been involved in ps and fixed a navigation bar on the top. the layout is given below. the position: fixed is used.
[Html]
Untitled Document
- Homepage
- Download
- Lexicon
- Others
- Help
- Official Forum
A
B
C
D
E
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
Untitled Document
- Homepage
- Download
- Lexicon
- Others
- Help
- Official Forum
A
B
C
D
E
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
Css code
[Css] @ charset "UTF-8 ";
/* CSS Document */
*{
Margin: 0px;
Padding: 0px;
Font-size: 14px;
}
Body {
Background-color: # ECECEC;
}
# Head {
Position: fixed;
Top: 0px;
Background: # FAFAFA;
Width: 100%;
Height: 54px;
Border-bottom: 1px solid # E8E8E8;
Box-shadow: 0 1px 5px rgba (34, 25, 25, 0.2 );
Z-index: 100;
}
# Header {
Margin: 0 auto;
Width: 960px;
Height: 54px;
}
. Nav {
Float: left;
Height: 54px;
Width: auto;
}
. Nav ul,. nav li {
Float: left;
List-style: none outside none;
}
Li {
Padding: 0 15px;
Color: #585858;
Display: block;
Line-height: 54px;
Border-right: 1px solid # E8E8E8;
}
# Main {
Position: relative;
Top: 66px;
Margin: 0 auto;
Padding: 10px;
Width: 960px;
Background: none repeat scroll 0 0 # FFFFFF;
Border: 1px solid # C7C7C7;
}
@ Charset "UTF-8 ";
/* CSS Document */
*{
Margin: 0px;
Padding: 0px;
Font-size: 14px;
}
Body {
Background-color: # ECECEC;
}
# Head {
Position: fixed;
Top: 0px;
Background: # FAFAFA;
Width: 100%;
Height: 54px;
Border-bottom: 1px solid # E8E8E8;
Box-shadow: 0 1px 5px rgba (34, 25, 25, 0.2 );
Z-index: 100;
}
# Header {
Margin: 0 auto;
Width: 960px;
Height: 54px;
}
. Nav {
Float: left;
Height: 54px;
Width: auto;
}
. Nav ul,. nav li {
Float: left;
List-style: none outside none;
}
Li {
Padding: 0 15px;
Color: #585858;
Display: block;
Line-height: 54px;
Border-right: 1px solid # E8E8E8;
}
# Main {
Position: relative;
Top: 66px;
Margin: 0 auto;
Padding: 10px;
Width: 960px;
Background: none repeat scroll 0 0 # FFFFFF;
Border: 1px solid # C7C7C7;
}