簡體   English   中英

鏈接整個DIV

[英]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> 

如何擁有一個整體<div>包含帶有 href 的鏈接</div><div id="text_translate"><p>我正在嘗試將“signup.php”的&lt;a href&gt;鏈接更改為 go 從NOW的單詞到整個&lt;div&gt; ,因此當用戶將鼠標懸停在該 div 內的任何內容上時,該鏈接將起作用:</p><p> <strong>HTML:</strong></p><pre> &lt;div class="row"&gt; &lt;div class="grid-full containerHomepage"&gt; &lt;div class="centered"&gt;SIGN UP TO HEAD SMART&lt;a class="noDecoration brain" href="signup.php"&gt; NOW&lt;/a&gt; &lt;img src="images/HeadSmart.png" width="50" height="60"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</pre></div>

[英]How to have a whole <div> contain a link with a href

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM