简体   繁体   English

shopify提前关闭html标签

[英]shopify liquid closing html a tag early

the following html+liquid code is not out putting what it should. 下面的html + liquid代码并未给出应有的内容。

 <div class="collection-item"> <a href="{{ collection.url }}"> <img src="{{ collection_image }}" alt="{{ collection_alt | escape }}" class="img-responsive collection-img"> <p class="collection-title">{{ collection_title}}</p> <div class="hover-content"> <div class="hover-content__wrap"> <p class="collection-title">{{ collection_title}}</p> <div class="divider"></div> <div class="cta"> <a href="{{ collection.url }}" class="btn btn--primary">Explore<i class="fa fa-long-arrow-right"></i></a> </div> </div> </div> </a> </div> 

in browser its closing the a tag early, and also outputting it multiple time unnecessarily, cant understand why. 在浏览器中,它会尽早关闭a标签,并不必要地多次输出它,无法理解原因。

 <div class="collection-item"> <a href="/collections/hats" style=" display: block; "> <img src=" //cdn.shopify.com/s/files/1/0746/5419/collections/hats_collection_500x500.png?v=1516731948 " alt=" Hats " class="img-responsive collection-img"> <p class="collection-title"> Hats </p> </a> <div class="hover-content"> <a href="/collections/hats"></a> <div class="hover-content__wrap"> <a href="/collections/hats"> <p class="collection-title"> Hats </p> <div class="divider"></div> </a> <div class="cta"> <a href="/collections/hats"></a> <a href="/collections/hats" class="btn btn--primary">Explore<i class="fa fa-long-arrow-right"></i></a> </div> </div> </div> </div> 

您有一个<a>包装了另一个<a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM