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