[英]Hiding tel: link on desktops
在此站點上, 網站鏈接在右上角有一個移動電話的tel:鏈接的聯系信息。 我們如何以最佳(最簡單)的方式隱藏tel:鏈接在桌面上? 現在我有這個:
CSS:
#header .contact-info1 { width: 253px; height: 50px; display: block; float: right; background: url(contact-info1.png) 0 0 no-repeat transparent; margin-right: 39px; margin- top: 110px; }
#header .contact-info2 { width: 292px; height: 51px; display: block; float: right; background: url(contact-info2.png) 0 0 no-repeat transparent; margin-right: 0px; margin- top: 30px; }
@media only screen and (max-device-width: 480px) {
#header .contact-info1-mobile { width: 253px; height: 50px; display: block; float: right; cursor: pointer; background: url(contact-info1.png) 0 0 no-repeat transparent; margin-right: 39px; margin-top: 110px; }
#header .contact-info2-mobile { width: 292px; height: 51px; display: block; float: right; cursor: pointer; background: url(contact-info2.png) 0 0 no-repeat transparent; margin-right: 0px; margin-top: 30px; }
HTML:
<a href="tel:+491796737741" class="contact-info1-mobile" ></a>
<div style="clear:right"></div>
<a href="mailto:info@rw-fliesen.com" class="contact-info2-mobile" ></a>
目前,我要隱藏台式機的鏈接,但是如何隱藏台式機的鏈接,同時又顯示台式機的聯系圖像?
您也可以使用jquery
通過$(window).resize
做到這一點
$(window).resize(function() {
var width = $(window).width();
if (width < 750) {
// Do Something
}
else {
//Do Something Else
}
});
通過使用jQuery or javascript
瀏覽器檢測為我評論中的鏈接提及的另一種選擇
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.