【问题标题】:How to center the image link inside div如何在 div 中将图像链接居中
【发布时间】:2014-02-19 22:36:45
【问题描述】:

我试图在 div 中居中图片链接,但是出了点问题。

我的代码:

<div id="screenshots">
    <figure class="sreenshot">
           <a href="/img/products_screenshots/15/opportunity.png" rel="screenshots" class="fancybox"><img alt="" id="screenshot0" src="/img/products_screenshots/15/opportunity.png"></a>
           <figcaption>Карточка "Продажи"</figcaption>
    </figure>
</div>

class="sreenshot"中间的每一块图片应该是什么样式? 现在看起来像这样Screencast

【问题讨论】:

    标签: css image hyperlink center


    【解决方案1】:

    无法看到您的代码,只要您的链接和图像设置为 display: inline;,您就应该能够在父元素上使用 text-align: center 以使其显示为容器的中心。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-02
      • 2017-08-08
      • 2014-04-30
      • 2015-08-19
      • 2016-11-04
      • 1970-01-01
      • 1970-01-01
      • 2012-05-06
      相关资源
      最近更新 更多