CSS绝对定位元素和边距 [英] CSS absolute positioned elements and margins

查看:257
本文介绍了CSS绝对定位元素和边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有权得出结论,CSS边距(例如左边距)会影响绝对定位元素的最终位置?看起来一个负边距左边(左边是绝对位置),右边是正值(绝对位置)。

Am a right to conclude that a CSS margin (e.g. margin-left) influences the final position of an absolute postioned element? It seems a negative margin-left pulls it to the left (of it's absolute postion), a positive value to the right (of it's absolute postion).

有人可以解释

推荐答案

正确。边距影响绝对定位元素的边缘开始的位置。

Correct. Margins influence where the edges of an absolutely positioned element begin.

这篇关于CSS绝对定位元素和边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆