Make the embed placeholder fit your page and treat both answers equally

Style the TermsFeed Privacy Consent (CMP) embed placeholder from your own stylesheet in 5 steps: target it, reserve its space, match your design, balance the buttons, and check the result. The embed placeholder is the box Privacy Consent shows in place of a blocked iframe, image, or vendor <div> until the visitor accepts its vendor. Its text is fixed per language, and it takes the colors of your consent banner unless your CSS changes them.

Have at least one replaceable iframe or image, or one vendor with on-accept HTML, on a page of your site, and access to a stylesheet that loads there. Set up the blocked element first with Replaceable Tags.

What the embed placeholder contains

The embed placeholder says why the content is missing, names the vendor, and offers 4 buttons that save an answer at once. Privacy Consent fills it from the vendor settings and the language the visitor uses, and the TermsFeed app has no field to change its text.

The English version shows these parts, top to bottom.

  • The heading. It reads "We need your consent to load vendor media content", and once a saved answer declines the vendor, "Unfortunately, this media content cannot be loaded because you rejected it."
  • The purposes. This is the purpose sentence the consent banner shows.
  • The vendor. This part holds the name, the line "This vendor may collect data about your activity.", and a link to the vendor privacy policy. A vendor that processes sensitive data adds a note.
  • Your Privacy Policy. A link appears when the consent banner has one set.
  • The way back. A "Privacy Preferences" link opens the Preferences Center.
  • The notice for Global Privacy Control (GPC). Only visitors whose browser sends the signal see it.
  • The buttons. I Agree and I Decline sit on the first row, and Accept this vendor and Decline this vendor on the second.
  • The credits link. A "Powered by TermsFeed" link sits under the buttons whenever the consent banner and the Preferences Center show it. Read when it shows in Remove the credits link.

I Agree and I Decline answer for every vendor category, not only this vendor. Accept this vendor on a first answer turns on this vendor alone and declines every other non-essential vendor, whose embed placeholders then say the visitor rejected them. The hide settings for the consent banner do not reach the embed placeholder, which keeps all 4 buttons.

Step 1: Target the embed placeholder with one CSS selector

Start every rule with .termsfeed-pc1-ec-wrapper, the class of the element that holds each embed placeholder. Each wrapper carries its vendor as a data attribute, so .termsfeed-pc1-ec-wrapper[data-termsfeed-pc1-vendor-id="termsfeed-1a2b3c4d-5e6f"] targets the embed placeholders of one vendor.

Privacy Consent adds its stylesheet at the end of <head> when it loads, so a tie between 2 rules goes to Privacy Consent. Give a property rule more classes than the rule it replaces, as the button rule in step 4 does. Custom properties need no extra classes. The Elements tab shows more wrappers than embed placeholders, because vendors with head code get a hidden wrapper at the end of <body>. Look up other selectors in DOM and CSS Selectors.

Step 2: Reserve the space of the final embed

Set a min-height equal to the height of the final embed on the container around the blocked element, so the page does not move when the embed replaces the embed placeholder. The embed placeholder takes the height of its own text and buttons, and it copies no size from the element it replaces. Its padding is 48 pixels, or 28 pixels with the Card, Bar, or Panel consent banner type.

Here is the rule for a 315-pixel video, with a class of your own on the container and a vendor <div> as the second selector.

.video-slot,
#termsfeed-1a2b3c4d-5e6f {
  min-height: 315px;
}

Wrap the replaceable tag in <div class="video-slot"> in your page. The <div> of an HTML vendor tag carries the vendor ID as its id, so the rule reaches it directly.

Step 3: Match the embed placeholder to your design

Set the 4 color properties and the font property on .termsfeed-pc1-ec-wrapper, which changes the embed placeholders and leaves the consent banner as it is. With the Card, Bar, or Panel consent banner type, --termsfeed-pc1-radius and --termsfeed-pc1-button-radius set the corners. Here is a rule for a light page with blue buttons and the font of your site.

.termsfeed-pc1-ec-wrapper {
  --termsfeed-pc1-banner-background-color: #f4f1ea;
  --termsfeed-pc1-banner-text-color: #1d1d1b;
  --termsfeed-pc1-button-background-color: #1d4ed8;
  --termsfeed-pc1-button-text-color: #ffffff;
  --termsfeed-pc1-font-family: Georgia, serif;
}

Keep a contrast ratio of at least 4.5 to 1 between each text color and its background. The color fields of the TermsFeed app warn at any lower ratio. Change the colors of the consent banner itself with Set the Colors of Your TermsFeed Privacy Consent Banner.

Step 4: Give accept and decline equal prominence

Make I Decline match I Agree, and keep all 4 buttons visible. With the Simple and Headline consent banner types, I Agree is bold and the other 3 are regular, while all 4 share one background color. With Card, Bar, and Panel, all 4 are bold and this rule changes nothing. Here is the rule for the first 2 types.

.termsfeed-pc1-ec-wrapper .termsfeed-pc1-ec .termsfeed-pc1-ec-rejectall-button {
  font-weight: 600;
}

Never hide I Decline or Decline this vendor with CSS, and never give them a color that fades into the background. The CNIL treats a refusal that is harder than an acceptance as a breach, as the French cookie enforcement post describes. Check the rest of your setup with Keep Accept and Reject Equally Easy.

Step 5: Check the embed placeholder in each state

Deploy your stylesheet first, and run this on a visit where the consent banner asks first, such as one from the EU.

  1. Close every private window, open a new one, open Chrome DevTools, select the Network tab, and type the vendor host in the filter box, such as youtube.
  2. Load the page. The embed placeholder shows with your colors and font, and no request to the host appears.
  3. Select the Elements tab, search for data-termsfeed-pc1-render-embed="true", select the wrapper, and confirm in the Styles pane that your rules apply and are not crossed out.
  4. Click Decline this vendor. The heading changes to the rejected text and takes the focus, the page keeps its height, and no request to the host appears.
  5. Close every private window, open a new one with the same filter, load the page, and click Accept this vendor. The embed loads in place, the request to the host appears, and the content after it does not jump.

The embed placeholder now fits your page, reserves the space of the embed, and presents both answers equally.