Home > Web Front-end > CSS Tutorial > css attributes relative positioning, absolute positioning, fixed positioning

css attributes relative positioning, absolute positioning, fixed positioning

不言
Release: 2018-05-03 14:49:43
Original
2370 people have browsed it

This article mainly introduces the relative positioning, absolute positioning and fixed positioning of css attributes. It has a certain reference value. Now I share it with you. Friends in need can refer to it

Positioning

1. 相对定位(position:relative)
    即相对于自己原先的位置定位,当盒子移动之后,原先的位置依然在存在
2. 绝对定位(position:absolute)
    默认是以body为基准定位,如果父级设置为相对定位之后,子元素的绝对定位就会以父级为起点.    定位之后能够设置框高
3.  固定定位(position:fixed)
    即相对于游览器定位,永远固定在用户的可视范围内
4. 定位方向冲突
    水平冲突(即left和right都设置),先执行left的设定
        垂直冲突,值执行top的设定.
Copy after login

       


The above is the detailed content of css attributes relative positioning, absolute positioning, fixed positioning. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template