Div overlay, centered

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> Untitled Document </title>
<!--Div overlay, centered, with nested--
<style type= "Text/css" >
#apDiv1 {
Absolute position of POSITION:ABSOLUTE;/*DIV1 * *
width:100%;/* length is 100%*/
left:0px;/* distance from the left in HTML */
top:0px;/* distance from above in HTML */
height:25px;/* Height */
Z-index:1;/*div the vertical axis, no longer the same div, if the number behind is larger than 1, the big Div is on the page */
Background-color: #F00; */* Background color */
Color: #FFF; * * Font colors */
}
#apDiv2 {
Position:absolute;
left:0px;
top:25px;/* the distance from the top of the HTML, which is the height of the DIV1 */
width:100%;
height:60px;
Z-index:1;
Background-color: #0F0;
}
#apDiv3 {
Position:absolute;
left:0px;
top:85px;/* the distance from the top of the HTML, which is the height of div1 and Div2 */
width:100%;
height:20px;
Z-index:1;
Background-color: #FF0;
}
#apDiv4 {
Float:right;/*div4 right-aligned in DIV1 */
Height of height:19px;/*div4 */
Set all padding properties in the padding:0px;/* declaration */
Color: #fff; /*DIV4 Font Color */
Z-index:1;
margin-top:0px;
}
/*DIV5 in DIV6 * *
#apDiv5 {
Margin:auto;/*div5 the position of the center */
width:980px;
height:400px;
Z-index:1;
Background-color: #000; color of/*DIV5 * *
}
#apDiv6 {
Absolute position of POSITION:ABSOLUTE;/*DIV6 * *
left:0px;
top:25px;
width:100%;
height:100%;
Z-index:2;
}
</style>

<body>
<div id= "ApDiv1" ><a> set Home </a>|<a> add to Favorites </a> |<a> Contact Us </a><div id= "apDiv4 "> Connection URL:www.baidu.com</div></div>
<div id= "ApDiv2" > Second row </div>
<div id= "ApDiv3" > Third row </div>

<div id= "ApDiv6" ><div id= "APDIV5" ></div></div>

</body>

Div overlay, centered

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.