您好 pfaffman,
在拜读了您的帖子后,我向 Google Gemini 询问了可在 CSS 和 HTML 中使用的代码。
但是,它现在根本不显示广告了。
这是它建议使用的 CSS,但不确定是否正确。
/* -------------------------------------------------------------------------- */
/* CSS to control which ads are displayed in which categories */
/* -------------------------------------------------------------------------- */
/* Initially hide all category-specific ads. The [class*=\"-ad\"] selector is more general */
.house-ad[class*=\"-ad\"] {
display: none;
}
/* Homepage Ad (if you have one - adjust the body class if needed) */
body.list-latest .house-ad.homepage-ad,
body.list-top .house-ad.homepage-ad {
/* body.list-latest and body.list-top are common Discourse classes for \"Latest\" and \"Top\" */
display: block;
}
/* Category Specific Ads */
body.category-community-support .house-ad.category-community-support-ad {
display: block;
}
body.category-general .house-ad.category-general-ad {
display: block;
}
您是否有可能告诉我您使用的 CSS,或者我发布的 CSS 是否看起来正确?
这是 HTML
<div class="house-ad category-community-support-ad">
<a href="DESTINATION_URL" class="banner-ad" target="_blank">
<img class="desktop" src="DESKTOP_IMAGE_URL">
<img class="mobile" src="MOBILE_IMAGE_URL">
</a>
</div>