图像在浏览器调整大小时重叠。如何将它们分开?

发布于 2024-12-17 05:40:56 字数 581 浏览 2 评论 0原文

我有一个照片库,我的照片显示为缩略图。 当我调整浏览器大小时,它们会按照我想要的方式移动,但不是均匀地向下推到下一行,而是向下但彼此重叠。

当浏览器已满时,图像显示正常。这是一个屏幕截图,显示当浏览器较小时图像移动和重叠:

在此处输入图像描述

我当前使用此代码,如果这有帮助。

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:

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

还给你自由 2024-12-24 05:40:56

我不确定,但尝试而不是
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; }

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文