AdSense 广告组件演示
本页面展示所有可用的 AdSense 广告组件。在开发模式下,所有广告都会显示为占位符。
顶部横幅广告 (Leaderboard - 728×90)
广告
标准横幅 (Banner - 468×60)
广告
大矩形 (Large Rectangle - 336×280)
赞助内容
中矩形 (Medium Rectangle - 300×250)
赞助内容
响应式广告(自适应)
广告
垂直半页 (Vertical - 300×600)
赞助内容
移动端横幅 (Mobile Banner - 320×50)
广告
自定义尺寸 (320×100)
Advertisement
广告位
320 × 100
Slot: 0000000000
使用示例
导入组件
---
import AdBanner from '../components/ads/AdBanner.astro';
import AdRectangle from '../components/ads/AdRectangle.astro';
import AdResponsive from '../components/ads/AdResponsive.astro';
--- 横幅广告
<AdBanner
slot="1234567890"
size="leaderboard"
fullWidth=true
/> 矩形广告
<AdRectangle
slot="1234567890"
size="medium-rectangle"
/> 响应式广告
<AdResponsive
slot="1234567890"
fullWidth=true
/> 广告尺寸参考
| 尺寸名称 | 尺寸 (px) | 推荐位置 |
|---|---|---|
| Leaderboard | 728 × 90 | 页面顶部/底部 |
| Large Banner | 970 × 90 | 页面顶部 |
| Banner | 468 × 60 | 内容顶部/底部 |
| Large Rectangle | 336 × 280 | 内容内嵌、侧边栏 |
| Medium Rectangle | 300 × 250 | 侧边栏、内容内嵌(最常用) |
| Vertical | 300 × 600 | 侧边栏 |
| Mobile Banner | 320 × 50 | 移动端页面 |
| Responsive | 自适应 | 任何位置(推荐) |
开始使用 AdSense
查看 完整使用指南 了解如何在实际页面中集成这些组件。