图像在浏览器调整大小时重叠。如何将它们分开?
我有一个照片库,我的照片显示为缩略图。 当我调整浏览器大小时,它们会按照我想要的方式移动,但不是均匀地向下推到下一行,而是向下但彼此重叠。
当浏览器已满时,图像显示正常。这是一个屏幕截图,显示当浏览器较小时图像移动和重叠:
我当前使用此代码,如果这有帮助。
div.photoimg
{
margin:2px;
padding: 5px;
height:auto;
width:auto;
float:left;
text-align:center;
}
div.img photoimg
{
display:inline;
margin:3px;
}
div.img a:hover img
{
border:1px solid #0000ff;
}
div.desc
{
text-align:center;
font-weight:normal;
width:200px;
margin:2px;
}
非常感谢您的帮助。
I have a photo gallery and my photos are diplayed as thumbnails.
When I resize the browser they move as I want them to but instead of getting evenly pushed down on to the next line they instead go down but overlap oeach other.
When the browser is full, the images display fine. Here is a screenshot showing the images moved and overlapping when the browser is smaller:
I currently use this code if it helps.
div.photoimg
{
margin:2px;
padding: 5px;
height:auto;
width:auto;
float:left;
text-align:center;
}
div.img photoimg
{
display:inline;
margin:3px;
}
div.img a:hover img
{
border:1px solid #0000ff;
}
div.desc
{
text-align:center;
font-weight:normal;
width:200px;
margin:2px;
}
Many thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定,但尝试而不是
div.img photoimg { 显示:内联; }
使用
div.img photoimg { 显示:块; }
I am not sure, but try instead of
div.img photoimg { display:inline; }
use
div.img photoimg { display:block; }