在<a> clickable

时间:2017-04-07 15:17:52

标签: html css3 anchor

I'm trying to make the entire content inside the <a> tag clickable but only the text is right now.

Here a CodePen: http://codepen.io/francobermudez/pen/dvBpNw?editors=1100

中创建整个

HTML:

<section id="ultimos-eventos">
    <div class="eventos-wrap">

        <a href="#">
            <div class="evento">
                <div class="evento-fecha">
                    <div class="evento-dia">20</div>
                    <div class="evento-mes">MAR</div>
                </div>
                <div class="evento-info">
                    <div class="evento-titulo">This is my title</div>
                    <div class="evento-subtitulo">
                        <div class="evento-direccion"><div></div>This is my subtitle</div>
                        <a class="btn-evento btn-azul" href="#">Detalles</a>
                    </div>
                </div>
            </div>
        </a>

    </div>
</section>

1 个答案:

答案 0 :(得分:2)

您在链接中有一个链接(&#34; Detalles&#34;文本) - 这是无效的。删除内部链接(即将其转换为常规文本div或p标记),您就可以单击整个容器。

&#13;
&#13;
<section id="ultimos-eventos">
    <div class="eventos-wrap">

        <a href="#">
            <div class="evento">
                <div class="evento-fecha">
                    <div class="evento-dia">20</div>
                    <div class="evento-mes">MAR</div>
                </div>
                <div class="evento-info">
                    <div class="evento-titulo">This is my title</div>
                    <div class="evento-subtitulo">
                        <div class="evento-direccion"><div></div>This is my subtitle</div>
                        <div>Detalles</div>
                    </div>
                </div>
            </div>
        </a>

    </div>
</section>
&#13;
&#13;
&#13;

http://codepen.io/anon/pen/GWbNjN?editors=1100