Admob Native Ad CSS Google Info按钮背景颜色

时间:2017-04-14 12:53:06

标签: css admob native-ads

我们如何从css更改Google广告信息按钮的背景颜色。我们已自定义广告,但我们无法更改Google广告信息按钮的背景颜色。我已经看到一些改变了颜色的原生广告,即使我删除了添加代码的每一部分它都没有去任何地方,那么我怎么能改变它的背景颜色呢?我添加了css代码和图片admobCss

    /* Note: 1px = 1dp in this css */

/* == Colors == */
body {
  background-color: #ffffff;
}
.title-link {
  color: #000000;
}
.button {
  background-color: #9D0000;
}
.button-text,
.button-link {
  color: #FFFFFF;
}
.price,
.reviews {
  color: rgba(0,0,0,0.5);
}
.reviews svg {
  fill: rgba(0,0,0,0.7);
}
.url-link {
  color: rgba(0,0,0,0.3);
}
.body {
  color: rgba(0,0,0,0.7);
}

/* == Fonts == */
body {
  font-family: "Lobster";
  font-weight: normal;
  font-size: 10px;
}
@media (min-height: 300px) {
  body {
    font-size: 11px;
  }
}
@media (min-width: 360px) and (min-height: 300px) {
  body {
    font-size: 12px;
  }
}
@media (min-width: 700px) and (min-height: 300px) {
  body {
    font-size: 16px;
  }
}
.title {
  font-size: 1.1em;
  line-height: 1.2em;
}
.button {
  font-size: 1.1em;
}
.body,
.price,
.reviews,
.url {
  font-size: 1em;
  line-height: 1.1em;
}
@media (min-width: 360px) and (min-height: 300px) {
  .title {
    font-size: 1.2em;
    line-height: 1.25em;
  }
  .button {
    font-size: 1.2em;
  }
}
@media (min-width: 700px) and (min-height: 300px) {
  .title {
    font-size: 1.3em;
    line-height: 1.35em;
  }
  .button {
    font-size: 1.3em;
  }
}

/* == Layout == */
.title {
  margin-bottom: 5px;
  padding: 5px 0 0 8px;
}
.body {
  margin: 2px 8px;
}
.button {
  position: absolute;
  bottom: 8px;
  left: 8px;
}
/* == App install and video ad layouts == */
.app-icon {
  float: left;
  margin: 0 8px 4px 8px;
  padding: 0;
}
.image-gallery,
.video {
  margin: 0 auto 8px auto;
}
/* == Content ad layout == */
.image {
  margin: 0 auto 4px auto;
}

/* == Body == */
.body {
  /* add more customizations here */
}

/* == App icon == */
.app-icon img {
  height: 50px;
  width: 50px;
  border-radius: 20%;
}
@media (min-width: 360px) and (min-height: 300px) {
  .app-icon img {
    height: 70px;
    width: 70px;
  }
}

/* == Title == */
.title {
  display: block;
  text-align: left;
}

/* == Button == */
.button {
  border: none;
  border-radius: 20px;
  box-shadow: 0 0 2px rgba(0,0,0,0.12), 0 2px 2px rgba(0,0,0,0.24);
}
.button-link {
  display: block;
  position: relative;
  padding: 0 1em;
}
.button svg {
  display: none;
}
.button {
  width: 90%;
  width: calc(100% - 16px);
  height: 2.8em;
}
.button-text {
  display: block;
  line-height: 2.8em;
  text-align: center;
}
@media (min-width: 700px) and (min-height: 300px) {
  .button {
    height: 2em;
  }
  .button-text {
    line-height: 2em;
  }
}

/**
 * == Large image and video ==
 * App install:
 *   Use .image-gallery selector
 * Content:
 *   Use .image selector
 * Video:
 *   Use .video selector
 */
.image-link,
.image img {
  width: 100%;
  height: 100%;
}
.image-gallery a,
.image a {
  display: block;
  line-height: 0;
}
.image-gallery,
.video,
.image {
  width: 90%;
  width: calc(100% - 16px);
}
.image-gallery,
.video {
  height: 50%;
  height: calc(100% - 11em);
}
.image {
  height: 50%;
  height: calc(100% - 10em);
}
@media (min-width: 700px) and (min-height: 300px) {
  .image-gallery,
  .video {
    height: calc(100% - 8.5em);
  }
  .image {
    height: calc(100% - 8em);
  }
}

/* == Attribution == */
.attribution {
  background-color: #ffffff;
  border-radius: 2px;
  color: #aeaeae;
  display: table;
  font-size: 10px;
  line-height: 13px;
  margin: 4px 8px;
  padding: 0 3px;
  position: absolute;
  top: 0;
  left: 0;
}
.rtl .attribution {
  background-color: #ffffff;
  left: auto;
  right: 0;
}

/* == Other == */
.ads a {
  text-decoration: none;
}
.ads, .ad {
  /**
   * DO NOT TOUCH OR REMOVE
   * Will break image rendering
   */
  height: 100%;
  width: 100%;
  padding: 0;
  word-wrap: break-word;
}
.ad {
  /* Padding for attribution */
  padding-top: 23px;
  height: calc(100% - 23px);
}

@DanielStorm找到了如何更改它但现在Admob不允许它 admob does not allow

1 个答案:

答案 0 :(得分:0)

我对CSS并不熟悉,但你可以检查元素,看看id是abgbg,默认情况下它的颜色设置为#cdcccc。我在屏幕截图中将其更改为橙色(#FFA500)。我不确定如何在CSS中表达,或者甚至可能,但这应该指向正确的方向。

enter image description here

修改

在玩了一下miniute后,你可以像这样改变背景颜色:

.abgbg {
    fill: #FFFFFF !important;
}