[英]Link a whole DIV
我想鏈接“項目-屬性” DIV。 如果需要,我可以編輯HTML和CSS,但是我不知道如何使其工作。
.item-attributes { display: table; width: 100%; height: 50px; } .item-attributes__item { display: table-cell; padding: 5px; text-align: center; vertical-align: middle; } .item-attributes__link i { margin: 0; margin-top: 0px; position: absolute; top: 50%; right: 0; vertical-align: middle; }
<div class="item-attributes"> <div class="item-attributes__item"> <a href="#" class="item-attributes__link"> <i class="fa fa-long-arrow-right"></i> </a> </div> </div>
另一種方法是使.item-attributes__item
成為您的鏈接。
.item-attributes { display: table; width: 100%; height: 50px; } .item-attributes__link { display: table-cell; padding: 5px; text-align: center; vertical-align: middle; background-color: #dfd; } .item-attributes__link i { margin: 0; margin-top: 0px; position: absolute; top: 50%; right: 0; vertical-align: middle; }
<div class="item-attributes"> <a href="#" class="item-attributes__link"> <i class="fa fa-long-arrow-right">Item</i> </a> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.