Search
Clear search
Close search
Google apps
Main menu

Learn more about the new AdMob rewarded ads

Fix native ads express validation errors

To avoid errors like those below, check out our CSS guide for help customizing the look and feel of your native express ad unit.

When you click the Validate button, AdMob reviews the native ad style of your native express ad unit for errors. This includes the overall design and any changes you may have made to the CSS code of the native ads express template.

Below is a list of several of the specific error messages you may receive while trying to validate your ad unit's native ad style. For more detailed requirements, review the native ads policies and guidelines and the AdMob & AdSense policies.

CSS errors

Syntax error at line [X] column [Y]: [values]

Error meaning

There was an error in the CSS code at the line and column shown in the error message.

Example: misspellings, incorrectly placed semicolon (;), missing brace symbol (})

When AdMob validates the syntax of your CSS code, it doesn't check that your code is complete and fully working. For instance, background-color: #invalidcolor; would be accepted. Please review the ad preview image to ensure that the ad is rendering as expected.

How to fix it

You can find the line numbers along the left side of the CSS editor window. Scroll down to the correct row and look for any typos or other errors that might appear in that line..

 

All font sizes must be between 10 and 24 pixels

Error meaning

The ad unit's CSS code contains a font size that is either too large or too small. Font sizes in native ads express are limited to a minimum size of 10 pixels and a maximum size of 24 pixels.

How to fix it

Search the CSS code for instances of the font-size property with a value lower than 10 pixels or higher than 24 pixels. Change the value to a number within the 10-24 pixel range.

[css selector or property] is not allowed

Error meaning

The CSS selector or property you've used in the ad unit's CSS code is not allowed in AdMob native ads express. To help ensure safe, reliable CSS, there are some properties, values, and selectors that are not allowed.

How to fix it

Review the list of disallowed CSS and edit your code to remove any disallowed selectors or properties.

You can also check out our HTML code samples for more information about what's allowed in native express ad units.

The style sheet cannot contain more than 12 media queries

Error meaning

Each declaration of a media query counts as 1, and your CSS code contains more than 12.

How to fix it

Review the CSS code and reduce the number of media queries until it contains 12 or fewer instances.

The style sheet contains too many media query size ranges. Style sheets may contain up to 6 unique sizes across width and height at validation.

Error meaning

we test your responsive ad unit at a range of preview sizes that can be targeted by all of your specified media queries. This ensures that the ad unit renders correctly across various devices and screen sizes. For example, if you specified (width: 300px) and (min-height: 300px), we might try validating your CSS against preview sizes of 300dp x 300dp and 300dp x 301dp. The CSS code may only contain 6 of these sizes for validation.

How to fix it

Review the CSS code and reduce the number of thresholds you’ve defined in your media queries. Then, try validating the code again.

Media query (width:[X]px) and (width:[X]px) can't be resolved to a valid ad size

Error meaning

The media query contains invalid parameters.

How to fix it

Review the CSS code to check that all media queries can be resolved to valid ad sizes.

The borders of elements inside the Ads container must not be larger than 2px

Error meaning

Borders in native ads express cannot exceed 2 pixels in thickness. A border in your native ad unit has exceeded the limit.

How to fix it

Review the CSS code and the ad preview image to locate any border(s) larger than 2 pixels. Change the border(s) value to 2 pixels or less, then click the Validate button to revalidate the native ad style.

Invalid use of box-shadow property for element(s) inside the Ads container

Error meaning

There are errors in the implementation of the box-shadow property.

How to fix it

Review the CSS code to ensure it complies with the following:

  • Elements cannot have offset-x or offset-y values > 5px
  • Elements cannot have a spread-radius of 0
  • Elements cannot have an inset value set for box-shadow

 

Policy errors

There is a problem with your ad customizations. Please review your settings above.

Error meaning

There is an error in your CSS code that can't be easily specified.

How to fix it

Review the CSS code, ad preview image, and native ads policies and guidelines to determine the cause of the error.

Added clickable whitespace around the [Element] must be removed

Error meaning

Clickable whitespace has been added around the element named in the error. Adding clickable whitespace around any element except buttons is a violation of the native ads policies and guidelines.

How to fix it

Remove the clickable whitespace around the element named in the error. For instance, if you've added padding to any anchor element (e.g., .title-link, .url-link elements), you should remove it and apply the padding to the parent element instead (e.g., .title, .url).

The [Element] must not be hidden, obscured or illegible

Error meaning

Hiding the element named in the error is a violation of the native ads policies and guidelines. During validation, AdMob detected that this element was no longer visible in the ad unit.

How to fix it

Review the CSS code and make changes so that the element named in the error is visible.

Please note the following:

  • For button elements, you are allowed to hide either one of the child elements (the text span element or the .SVG icon). You are not allowed to hide the entire button element or both child elements.
  • For star rating elements, you are allowed to hide the entire element or hide the number of reviews. You cannot hide any of the stars in the review, unless you hide the entire element.
The [Element] does not have sufficient contrast between font and background colors

Error meaning

During validation, AdMob detected that element colors were too similar. Element colors can't be too similar to the background or font colors around them. This might make text that appears in the ad unit difficult to read.

Example: red text on a red background, a beige button on a white background

How to fix it

Review the CSS code and the ad preview image to locate any instance(s) of the element named in the error that may be need a color adjustment and change the value. The minimum readable contrast ratio for AdMob native ads express is 1.81:1. We also recommend that you not make changes to the Ad Attribution colors.

There are many color contrast calculators online that can help you calculate the contrast ratio between the colors you want to use.

Using gradients

You are allowed to set the background color of some elements as transparent. If you do, we'll check element colors against the background of the ad unit. If you use a gradient for any background color, we’ll check that all elements have acceptable contrast values against all steps of the gradient.

Attribution must be positioned at the top corner of the ad. For left-to-right languages, the label should be left-aligned with the ad unit. For right-to-left languages, the label should be right-aligned

Error meaning

The position of the Ad Attribution in your ad unit violates the native ads policies and guidelines. Ad Attribution must be located at the top corner of the ad: left-aligned for left-to-right languages and right-aligned for right-to-left languages.

How to fix it

Edit the CSS code to ensure the Ad Attribution is located at the top corner of the ad unit and is aligned to the correct side based on the direction of the language being used.

The [Element] and its child elements must not overlap with other elements. Text displayed in the [Element] must not be excessively truncated or truncated without using ellipsis.

Error meaning

Elements may not overlap other elements in the native express ad unit. This is normally due to the width or height of an element being set too high.

How to fix it

Review the CSS code and the ad preview image to locate any instance(s) of the element named in the error that may be overlapping other elements of the ad unit:

  • Check that all child elements of the element named in the error are not overlapping with any other elements.
  • Check that any text elements are not truncated unreasonably.

You can use the CSS editor to change the background-color of the element named in the error to visually check if the parent element rectangle touches any other ad elements. Change the width and height values until the element(s) no longer overlaps other elements, then click the Validate button to revalidate the native ad style.

When you’ve fixed the error, just change the color back again in the editor.

 

If there aren’t any clearly visible areas of overlap, you may need to check for hidden sources of overlap caused by:

  • Setting the display: block property on an element without setting a width and height. This will cause the width of the element to default to 100%, which will result in this error. Add the width and height values to the display: block property to correct it.
  • Setting a style on a parent element (such as .button { border-radius: 20px; }) without setting the same style on a child element (such as .button-link) or without setting a child element’s position relatively (such as .button-link { position: relative; }). This will trigger an overlap error between the child element and other elements.
  • Using the combination of overflow: hidden, text-overflow: ellipsis, and white-space: nowrap to hide text overflow. This may cause the amount of text truncation to violate the native ads express policies and guidelines.
  • Setting overflow: hidden for the element. This is a valid CSS property, especially if you use it in conjunction with text-overflow: ellipsis for text truncation. However, if you happen to trigger this validation error, you can try adding more padding—instead of margin—or setting the height of the element manually.
[Element] child elements must be placed inside the [Element] element

Error meaning

Child elements of the element named in the error are located outside the parent element.

How to fix it

Review the CSS code and the ad preview image to locate any instance(s) of child elements of the element named in the error that may be located outside of their parent element. Inspect the element(s) to make sure each child element has a size that is ≤ to the parent element, and that it's located inside the parent element.

The [Image gallery/Video] width must not be less than 50% of the ad area width and its height must not be less than 33% of the ad area height

Error meaning

The image gallery, video, and image elements in a large template are too small. The image gallery, video, and image elements in large templates are meant to feature prominent image and video content.

How to fix it

Review the CSS code and adjust the sizing for the image gallery, video, and/or image elements.

Image elements should match the size of the image gallery element in the corresponding app install ad.
The [App icon/Image] must not be less than 40 pixels in width or 40 pixels in height

Error meaning

The named app icon or image is less than 40 pixels in width or height and is too small.

How to fix it

Review the CSS code and adjust the app icon or image's size to more than 40 pixels in width and height.

Was this article helpful?
How can we improve it?
Sign in to AdMob

Sign in to see help for your AdMob account Sign in Don't have an AdMob account? Sign up today! Sign up for AdMob