All search styles have a default style. This is the styling that's applied to pages that use its style ID. However, you can apply a different style instead of the default style by using conditional styling.
Conditional styling lets you apply different styling to your search results pages on different platforms and to parts of a single page. For example, you might you want to apply different styling to your ads when they appear on desktop versus mobile.
You use style rules to specify when you want a conditional style to be applied. You can create style rules for platforms (desktop, mobile, etc.) and/or ad containers. For example, let's say you have a style (mobilestyle1) that you want to apply when your ad container (afscontainer1) appears on mobile. You'd create a style rule like this: apply mobilestyle1 if platform is mobile and container ID is afscontainer1.
How to set up a conditional style
- Sign in to your AdSense account.
- Click Ads for search, then Search styles.
- Click Edit next to the style you want to apply rules to.
- Click the conditional styling button .
- In the "Conditional styling" panel, click + Add conditional style.
- Enter a name for your conditional style.
- Create a style rule by selecting a platform and (optionally) entering a container ID.
Tip: To apply your conditional style to all containers on the page, except those that are targeted by ID in other conditional styles, leave the container ID field blank.
- Click Save. If you've made changes to the styling for this rule, you'll also be asked to choose a saving option.
Edit the style rule for a conditional style
- Sign in to your AdSense account.
- Click Ads for search, then Search styles.
- Click Edit next to the style with the conditional style you want to edit.
- Click the conditional styling button .
- In the "Conditional styling" panel, find the conditional style you want to edit.
- Click More Edit.
- Make the required changes to your style rule.
- Click Save.
- Click Save to confirm.
Note: When you update a style rule it immediately affects all search ads that use that style.
Delete a conditional style
- Sign in to your AdSense account.
- Click Ads for search, then Search styles.
- Click Edit next to the style with the conditional style you want to delete.
- Click the conditional styling button .
- In the "Conditional styling" panel, find the conditional style you want to delete.
- Click More Delete.
- Click Delete to confirm.
Note: When you delete a conditional style it immediately affects all search ads that use that style.