css - 当位置是相对的时,元素的填充和边距会改变吗?

标签 css css-position margin padding

Relative positioning moves an element in relation to where it would have been in normal flow. HTML&CSS: design and build websites. John Duckett

当元素的属性位置是相对的时,您可以使用 top、left、bottom 和 right 属性来移动该元素相对于它在正常流中的位置。

我想知道这些属性是否会影响填充和边距属性。

谢谢

最佳答案

他们没有。填充和边距值将保持不变。

关于css - 当位置是相对的时,元素的填充和边距会改变吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27172572/

相关文章:

html - 如何设置显示为圆圈的div的垂直对齐?

css - 居中绝对定位的 div 与绝对 child 水平

html - CSS height auto 在相对 DIV 中不起作用

css - 动画时禁用滚动条

html - 无论窗口大小如何定位元素

javascript - 如何改进这段代码,转换字符串

css - 为特定用例在 CSS 站点上创建可用的自定义字体系列

css - 卡住/快照 CSS 并获取值

html - 为什么我的边距会崩溃,即使我对所有内容都有边框?

javascript - 防止提交 HTML 表单字段