DIV 内图像的填充/边距
好的。我最近对此网站进行了一些更新。
http://annberingerart.com/index.php
进行一些细微的更改后,边距和填充似乎因为索引页上的图像已更改。我希望所有图像之间的垂直和水平填充均相等,并且边距一致。
此外,我在朋友安装了 Safari 5 的 MAC 上查看该网站时,整个包装器的大小似乎有所缩小,因为它无法像我进行更改之前那样包含其子级。
你可以看一下 firebug 中的 CSS,因为在这里发布 400 多行 CSS 会显得冗长且过多。
欢迎任何和所有的批评,但我最想要的是如何解决这个问题的建议。
Ok. I recently made some updates to this website.
http://annberingerart.com/index.php
Upon making some minor changes it seems that the margin and padding for the images on the index page has changed. I would like for there to be equal padding both vertically and horizontally between all images as well as a consistent margin.
In addition, I was viewing the website on a friend's MAC with Safari 5 installed and the entire wrapper seemed to have shrunk in size because it could not contain its children as it had before I made the changes.
You can take a look at the CSS in firebug as it would be lengthy and excessive to post 400+ lines of CSS on here.
Any and all criticism is welcome, but I mostly want advice on how to fix this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的水平边距是由空格/换行符引起的,因为图像是内联元素(实际上是内联块......)。
如果您浮动图像,您将可以更好地控制精确的边距,而不是依赖于空格/换行符的宽度。
要解决您的问题,您可以:
overflow:hidden
;Your horizontal margin is caused by spaces / new-lines because the images are inline elements (sort of inline-block really...).
If you float the images, you will have more control over the exact margins instead of depending on the width of a space / new-line.
To solve your problem, you could:
overflow:hidden
;