简体   繁体   中英

Add Google DFP ad unit heading (“Advertisement”) to all the ads with a white background and a padding

We have Google DFP ad units on our site and we need to add an "Advertisement" text heading and a white background with padding to all the ads. The design should be as follows.

在此处输入图像描述

Can someone please help me to achieve the above?

To do so, i will use css. Let's suppose all your ad slots have a class "adstyle":

<div id="banner" class="adstyle">
here is where the GAM iframe will be inserted
</div>

<style>
.adstyle {
  width:auto;
  background: #fff;
  padding:20px;
  position:relative;
 }

.adstyle:before {
  content : '- ADVERTISEMENT -';
  display : block;
  witdh: 100%;
  height: 30px;
  font-weigt:14px;
  text-align : center;
  margin : 0 0 20px 0;
}
</style>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM