0
我使用谷歌dfp服務我的廣告在網站上。我需要在不同地方擔任桌面和移動不同的地方,所以我儘量讓這樣的:谷歌dfp廣告與雙ID
.mobileShow { display: none;}
/* Smartphone Portrait and Landscape */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px){ .mobileShow { display: inline;}}
.mobileHide { display: inline;}
/* Smartphone Portrait and Landscape */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px){ .mobileHide { display: none;}}
<div class="mobileShow">
<div id='div-gpt-ad-1421767832590-6' style='width:300px; height:250px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1421767832590-6'); });
</script>
</div>
</div>
<div class="mobileHide">
<div id='div-gpt-ad-1421767832590-6' style='width:300px; height:250px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1421767832590-6'); });
</script>
</div>
</div>
,並添加我的代碼:.mobileshow的地方,我想要在移動設備和桌面.mobilehide中顯示。 但dfp只能在一個頁面中提供一個代碼(id)。顯示:無;它沒有服務,但也是第二個代碼不顯示。 我可以幫忙嗎