Home > Article > Web Front-end > css relative positioning
[Introduction] CSS absolute positioning allows you to accurately position elements at independent locations on the page, regardless of the positioning settings of other elements on the page. Relative positioning means that the feature you are positioning is positioned relative to its assigned position in the file. Example: I { position: relative; left: 40px; t
css absolute positioning allows you to accurately position the independent position of elements on the page, regardless of the positioning settings of other elements on the page. Relative positioning means that the feature you are positioning is positioned relative to its assigned position in the file. Example:
I { position: relative; left: 40px; top: 10px }
The key to relative positioning is that the position of the positioned element is relative to its normal position should be positioned at the location. If you stop using relative positioning, the text's display position will return to normal.
Be careful when using relative positioning, otherwise the page will be very messy.
In addition to relative positioning and absolute positioning, you can also use static parameter values. Its usage is the same as the positioning method in ordinary HTML, and special positioning settings cannot be attached.
its not bad, right? Below we'll learn how to control positioned elements.
The above is the detailed content of css relative positioning. For more information, please follow other related articles on the PHP Chinese website!