锚标签不使用bootstrap的数字标签

时间:2016-08-02 13:37:59

标签: php css wordpress twitter-bootstrap

我想在用户点击图片时将用户重定向到该链接,但锚点标记在点击图片时不起作用。但是“点击这里”的锚标签有效。

<a href="http://google.com">
<figure class="effect-ming">

<img src="http://example.com/dd.img" alt="Placeholder" />

    <figcaption>
        <p><?php the_title(); ?></p>
        <a href="<?php the_permalink(); ?>">CLICK HERE</a>
    </figcaption> 
</figure>
</a>

css:

figure.effect-ming figcaption::before {
  border: 0px solid #fff !important;  
  bottom: 30px;  
  box-shadow: 0 0 0 0px rgba(0, 0, 0, 0) !important;  
  content: "";  
  left: 30px;  
  opacity: 0;  
  position: absolute;  
  right: 30px;  
  top: 30px;  
  transform: scale3d(1.4, 1.4, 1);  
  transition: opacity 0.35s ease 0s, transform 0.35s ease 0s;  
}  

1 个答案:

答案 0 :(得分:1)

您需要关闭锚标记:

<a href="http://google.com">
    <img src="http://example.com/dd.img" alt="Placeholder" />
</a>

<figure class="effect-ming">
    <figcaption>
        <p><?php the_title(); ?></p>
        <a href="<?php the_permalink(); ?>">CLICK HERE</a>
    </figcaption> 
</figure>

我认为这会更好。我移动了figure标记,因为嵌套不正确。如果你想要图中的图像,你可以这样做:

<figure class="effect-ming">


    <a href="http://google.com">
        <img src="http://example.com/dd.img" alt="Placeholder" />
    </a>

    <figcaption>
        <p><?php the_title(); ?></p>
        <a href="<?php the_permalink(); ?>">CLICK HERE</a>
    </figcaption> 
</figure>