Examples of the application of absolute and relative

Source: Internet
Author: User
Tags relative

Div + CSS page layout, the appropriate use of absolute and relative, can give the layout to bring unexpected effects and convenience, to achieve a multiplier. This paper introduces the application of absolute and relative.

To explain the relationship between the two, need to cooperate with examples, please see the example first:

The following is a reference fragment:




div + CSS Example, wayhome ' s blog



Position:absolute;

Top:5px;

Right:20px;


Position:absolute;

Left:20px;

Bottom:10px;




Position:absolute;

Top:5px;

Left:5px;



Position:relative;

Left:150px;



width:300px; height:50px;




1


2


3


4


5



padding:20px 0 0 20px;
position: absolute;


Position: relative;

Left:200px;



Width:300px;

Height:300px;


Position:absolute;

Top:20px;

RIGHT:20PX;<BR/>


Position:absolute;

Bottom:20px;

Left:20px;










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.