保证金值之间有差异吗?
我正在设计一项设计,div 内有一个 div
<div id="header"><div id="header-top"></div></div>
“#header”具有深色背景颜色,“#header-top”具有浅色背景颜色。 “#header 的边框半径也为 7px。
在 css 中,“#header-top”的边距类似于“margin: 10px 0 0 10px;”,因此它被向下推 10px,向左推 10px,使其成为居中并且在浅色内部背景周围出现深色边框,
但是顶部“边框”似乎比侧面边框更薄 CSS 是否使顶部 10 像素与侧面 10 像素不同?
I am working on a design and a have a div inside a div
<div id="header"><div id="header-top"></div></div>
"#header" has a dark background color and "#header-top" has a light one. "#header also has a border-radius of 7px.
In the css "#header-top" has a margin like this "margin: 10px 0 0 10px;" so it is pushed down by 10px and to the left by 10px making it centered and the appearance of a dark border around the light inner background.
However it seems that the top 'border' is thinner than the side borders. Does css make it such that 10px on top is different than 10px on the sides?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
#header-top 的上边距可能会穿过#header 的边缘,尽管脱离上下文很难确定。请参阅http://complexspiral.com/publications/uncollapsing-margins/
The top margin of #header-top is probably sticking through the edge of #header, although it is hard to say for sure out of context. See http://complexspiral.com/publications/uncollapsing-margins/