Multiple block-level elements occupy a horizontal position, and when the window becomes larger and smaller, four pictures still move with it, showing the effect of the response style.

Source: Internet
Author: User

principle: Block-level elements want to be centered horizontally and vertically on the page: first to position the element (absolute positioning), then horizontally: left=50%,margin-left=-(1/2*width)Vertical Orientation Page Center: top=50%,margin-top=-(1/2*height)The code is as follows:<Divclass="Footer_top">
<Divclass="Footer_slogen">
<spanclass="One"><imgsrc="Images/slogen1.png"alt=""/></span>
<spanclass="both"><imgsrc="Images/slogen2.png"alt=""/></span>
<spanclass="three"><imgsrc="Images/slogen3.png"alt=""/></span>
<spanclass="Four"><imgsrc="Images/slogen4.png"alt=""/></span>
</Div>
<Divclass="Footer_product"></Div>
</Div>.Footer_top{
position:relative;
}
.Footer_slogenspan{
position:Absolute;
    Left: -%;
}
.Footer_slogen. One{
Margin-left: -605px;
}
.Footer_slogen. Both{
Margin-left: -294px;
}
.Footer_slogen.three{
Margin-left:0px;
}
.Footer_slogen. Four{
Margin-left: thepx;}Note: (1), after absolute positioning, does not give the LRTB value, the default will be in the original standard flow position display. (2), the level of four graphs are stacked together as one(only relative positioning and absolute positioning and solid-state positioning elements have a hierarchical concept, and floating and standard flows are not hierarchical, if several adjacent elements are positioned in the same position the elements in the back are pressed against the front elements, but the Z-index are 0 .) (3), in percent positioning, no use of margin-right

Multiple block-level elements occupy a horizontal position, and when the window becomes larger and smaller, four pictures still move with it, showing the effect of the response style.

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.