html - 我需要将图像放在画廊的中心,但没有任何效果

标签 html css wordpress alignment center

我买了一个名为 Photographer 的 wordpress 主题,我尝试在图库中显示图像。

我在他们的支持论坛上问过,他们给了我这个代码

.gallery-item {  text-align: center; width: 100%; }

但这会将肖像图像拉伸(stretch)到风景图像的宽度,从而使它们变得非常长。 我尝试了我设法找到的每一个解决方案,这似乎是不可能的。 我提到即使在 Wordpress 页面编辑器中我也将图像居中对齐。

示例页面在这里:http://vladilas.ro/test/portfolio/mihaela-si-paul-gura-humorului-rarau-2015/

如果有人知道如何解决这个问题,我们将不胜感激。

谢谢!

最佳答案

试试这个:

.gallery-item {margin: 0 auto;}

关于html - 我需要将图像放在画廊的中心,但没有任何效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47756097/

相关文章:

html - 如何从 Accordion 图案中删除底部边框?

html - 图片表现异常

javascript - 如何防止 fadeIn/Out 在展开/折叠标题时闪烁?

php - 根据域显示不同的内容

javascript - 在媒体窗口中选择图片后添加/更新自定义字段 (Wordpress)

mysql - SELECT DISTINCT 数据不同但未被过滤

php - 这是wordpress病毒吗?

javascript - Revolution Slider - 有独立的编辑器吗?

javascript - 地理定位 api 中是否有类似 isGeolocationAllowed 或 isGeolocationAllowedForever 的函数?

css - sass --watch : Compile only 1 css with many sources