Php practice 19th days

Source: Internet
Author: User

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] <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Link rel = "stylesheet" type = "text/css" href = "css/in.css"/>
 
</Head>
 
<Body>
<Div id = "head">
<Div id = "header">

<Div class = "nav">
<Ul>
<Li> <a> Home page </a> </li>
<Li> <a> download </a> </li>
<Li> <a> lexicon </a> </li>
<Li> <a> others </a> </li>
<Li> <a> help </a> </li>
<Li> <a> official forum </a> </li>
</Ul>
</Div>



</Div>
</Div>
<Div id = "main">
A <br/>
B <br/>
C <br/>
D <br/>
E <br/>
123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/>
</Div>
</Body>
</Html>

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Link rel = "stylesheet" type = "text/css" href = "css/in.css"/>

</Head>

<Body>
<Div id = "head">
<Div id = "header">

<Div class = "nav">
<Ul>
<Li> <a> Home page </a> </li>
<Li> <a> download </a> </li>
<Li> <a> lexicon </a> </li>
<Li> <a> others </a> </li>
<Li> <a> help </a> </li>
<Li> <a> official forum </a> </li>
</Ul>
</Div>



</Div>
</Div>
<Div id = "main">
A <br/>
B <br/>
C <br/>
D <br/>
E <br/>
123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/> 123456789 <br/>
</Div>
</Body>
</Html>
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;
 
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.