HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URL's added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!doctype html>
<html>
<head>
<script type="text/javascript">
var _iub = _iub || [];
_iub.csConfiguration = {
lang: "en", //to localize the cookie banner in an unsupported language (like Polish), set lang: "pl"
siteId: 896537, //use your siteId
cookiePolicyId: 8207462, //use your cookiePolicyId
//cookiePolicyUrl: "https://...", //cookie-less page containing the cookie policy in an unsupported language (like Polish), see "Localize the cookie banner in an unsupported language"
consentOnScroll: false, //avoid consent to be given when the user scrolls the page
enableCMP: true, //enable IAB Transparency and Consent Framework
perPurposeConsent: true, //enable per-category consent
banner: {
position: "float-top-center",
acceptButtonDisplay: true,
customizeButtonDisplay: true,
},
i18n: {
//list of all editable components/strings
en: {
banner: {
title: 'Notice',
paragraph_1: 'This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. If you want to know more or withdraw your consent to all or some of the cookies, please refer to the %{cookie_policy_link}.',
paragraph_2: 'By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to the use of cookies.',
dynamic: {
paragraph_1: 'This website or its third-party tools process personal data[if not gdprApplies and ccpaApplies].[/if][if gdprApplies] (e.g. browsing data or IP addresses) and use cookies or other identifiers, which are necessary for its functioning and required to achieve the purposes illustrated in the cookie policy[if enableCMP], including the following advertising-related purposes employed by the Owner and by %{vendor_list_link}: Information storage and access; Personalisation; Ad selection, delivery, reporting; Content selection, delivery, reporting; Measurement[/if]. [if not banner.customizeButtonDisplay]To learn more, please refer to the %{cookie_policy_link}. [/if][if enableCMP] You can freely give, reject, or revoke your consent without incurring major limitations, and change your ad-related choices at any time by accessing the %{advertising_preferences_link}.[/if][/if][if ccpaApplies]<br />In case of sale of your personal information, you may opt out by using the link \"%{do_not_sell}\". <br />To find out more about the categories of personal information collected and the purposes for which such information will be used, please refer to our %{privacy_policy}.[/if]',
paragraph_2: 'You accept the use of cookies or other identifiers by closing or dismissing this notice',
by_scrolling: 'by scrolling this page',
by_clicking_on_links: 'by clicking a link or button',
by_browsing: 'by continuing to browse otherwise',
or: 'or'
},
cookie_policy_caption: 'cookie policy',
vendor_list_caption: 'third-parties',
advertising_preferences_caption: 'advertising preferences panel',
do_not_sell_caption: "Do Not Sell My Personal Information",
privacy_policy_caption: "privacy policy",
accept_button_caption: 'Accept',
reject_button_caption: 'Reject',
customize_button_caption: 'Learn more and customize'
},
modal: {
save_and_go_back: 'Save and go back',
back: 'Back',
see_full_cookie_policy: 'See full Cookie Policy',
cookie_policy: 'Cookie Policy'
},
footer: {
message: 'By continuing to browse or by otherwise closing this window, you accept the current cookie settings.',
btnCaption: 'Save and continue'
},
cmp: {
show_tracking_button: 'Customize advertising tracking',
hide_tracking_button: 'Save and return to cookie policy',
widget_title: "Advertising tracking settings",
widget_intro: "The advertising services listed below allow the User to set advertising tracking preferences.<br />By switching on any advertising purpose or individual service, Users consent to such processing of their Data. Users can revisit these choices at any time.<br /><br />Some services among those listed below, if specified, may not request the Users' consent in order to process their Personal Data as such services rely on legitimate interest as a legal basis. Users have the right to object to such processing and may exercise that right by visiting the privacy policies of the respective services.",
widget_iab_title: "Personalized advertising from the services adhering to the <a href='https://iabeurope.eu/transparency-consent-framework/'>IAB Transparency and Consent Framework</a>",
widget_features_intro: "In order to pursue one or more of these purposes, third-party services may also use the following features:",
widget_other_providers: "Other providers",
vendors_section_title: "Manage preferences for each advertising service",
activate_all_purposes_button: "Accept all",
deactivate_all_purposes_button: "Reject all",
purposes_label: "Purposes:",
legit_purposes_label: "Purposes (legitimate interest):",
features_label: "Features:",
privacy_policy: "Privacy Policy",
purposes: {
1: {
name: "Information storage and access",
description: "The storage of information, or access to information that is already stored, on the User’s device such as advertising identifiers, device identifiers, cookies, and similar technologies."
},
2: {
name: "Personalization",
description: "The collection and processing of information about the User’s use of this Application to subsequently personalize advertising and/or content for them in other contexts, such as on other websites or apps, over time. Typically, the content of the site or app is used to make inferences about the User’s interests, which inform future selection of advertising and/or content."
},
3: {
name: "Ad selection, delivery, reporting",
description: "The collection of information, and combination with previously collected information, to select and deliver advertisements for the User, and to measure the delivery and effectiveness of such advertisements. This includes using previously collected information about the User’s interests to select ads, processing data about what advertisements were shown, how often they were shown, when and where they were shown, and whether they took any action related to the advertisement, including for example clicking an ad or making a purchase. This does not include personalization, which is the collection and processing of information about the User’s use of this Application to subsequently personalize advertising and/or content for them in other contexts, such as websites or apps, over time."
},
4: {
name: "Content selection, delivery, reporting",
description: "The collection of information, and combination with previously collected information, to select and deliver content for the User, and to measure the delivery and effectiveness of such content. This includes using previously collected information about the User’s interests to select content, processing data about what content was shown, how often or how long it was shown, when and where it was shown, and whether the User took any action related to the content, including for example clicking on content. This does not include personalization, which is the collection and processing of information about the User’s use of this Application to subsequently personalize content and/or advertising for them in other contexts, such as websites or apps, over time."
},
5: {
name: "Measurement",
description: "The collection of information about the User’s use of the content, and combination with previously collected information, used to measure, understand, and report on the User’s usage of the service. This does not include personalization, the collection of information about the User’s use of this Application to subsequently personalize content and/or advertising for them in other contexts, i.e. on another service, such as websites or apps, over time."
},
googleAdsPersonalized: {
name: "Personalized advertising from Google and its partners",
description: "Google and its partner ad technology providers use Cookies or other Identifiers for personalization and measurement purposes. Users can customize their consent preferences for both Google and its partners. To learn more, please refer to the <a href='https://support.google.com/admanager/answer/9012903?hl=en'>privacy policies of the respective services</a>."
}
},
features: {
1: {
name: "Matching Data to Offline Sources",
description: "Combining data from offline sources that were initially collected in other contexts."
},
2: {
name: "Linking Devices",
description: "Allow processing of a User's data to connect such User across multiple devices."
},
3: {
name: "Precise Geographic Location Data",
description: "Allow processing of a User's precise geographic location data in support of a purpose for which that certain third party has consent."
}
}
},
per_purpose: {
widget_title: 'Consent preferences',
widget_intro: 'The following panel allows you to customize your consent preferences for cookies or for any other identifying technology, employed either by us directly or by a third party. To learn more, check each category description and refer to the <button style="cursor: pointer; text-decoration: underline !important;" class="open-cp">cookie policy</button>. You may review and change your choices at any time.',
see_description: 'See description',
see_description_customize: 'See description and customize',
hide_description: 'Hide description',
approve_all: 'Approve all',
reject_all: 'Reject all',
adopts_tcf: 'Adopts the IAB Transparency and Consent Framework',
general_advertising_services: 'Other Targeting & Advertising services',
tcf_adhering_services: 'IAB Transparency and Consent Framework adhering services',
tcf_adhering_services_description: 'These services adhere to the <a href="https://iabeurope.eu/transparency-consent-framework/">IAB Transparency and Consent Framework</a> (TCF). The TCF is an industry-wide initiative that facilitates responsible privacy practices across the digital advertising industry, providing Users with enhanced transparency and control over their advertising tracking preferences.',
customize_advertising_tracking: 'Customize advertising tracking',
purposes: {
1: {
name: 'Strictly necessary',
description: 'These cookies or other identifiers are used for activities that are strictly necessary to operate or deliver the service you requested from us and, therefore, do not require you to consent.'
},
2: {
name: 'Basic interactions & functionalities',
description: 'These cookies or other identifiers enable basic interactions and functionalities that allow you to access selected features of our service and facilitate your communication with us.'
},
3: {
name: 'Experience enhancement',
description: 'These cookies or other identifiers help us provide a personalized user experience by improving the quality of your preference management options and by enabling the interaction with external networks and platforms.'
},
4: {
name: 'Measurement',
description: 'These cookies or other identifiers allow us to measure traffic and analyze your behavior with the goal of improving our service.'
},
5: {
name: 'Targeting & Advertising',
description: 'These cookies or other identifiers enable us to deliver personalized marketing content to you based on your behavior and to operate, serve and track ads.'
},
googleAdsPersonalized: {
name: "Personalized advertising by Google and its partners",
description: "Google and its partner ad technology providers use cookies or other identifiers for personalization and measurement purposes. You can customize your consent preferences for both Google and its partners. To learn more, please refer to the <a href='https://support.google.com/admanager/answer/9012903?hl=en'>privacy policies of the respective services</a>."
}
}
},
ccpa: {
opt_out_prompt: 'Do you really wish to opt out?',
opt_out_cancel: 'Cancel',
opt_out_confirm: 'Confirm',
},
},
//some sample strings translated into an unsupported language (Polish)
pl: {
banner: {
title: 'Uwaga',
paragraph_1: 'Niniejsza witryna lub stosowane na niej narzędzia osób trzecich wykorzystują pliki cookie, które są niezbędne do jej działania i konieczne do osiągnięcia celów przedstawionych w polityce plików cookies. Jeśli Użytkownik chce dowiedzieć się więcej lub wycofać swoją zgodę na stosowanie wszystkich lub niektórych plików cookies, prosimy o zapoznanie się z %{cookie_policy_link}.',
paragraph_2: 'Zamykając ten baner, klikając link lub kontynuując przeglądanie strony, Użytkownik wyraża zgodę na stosowanie plików cookies.',
cookie_policy_caption: 'polityką plików cookies',
accept_button_caption: 'Zaakceptuj',
customize_button_caption: 'Dostosuj',
},
footer: {
message: 'Kontynuacja przeglądania strony lub zamknięcie tego okna oznacza akceptację stosowania plików cookies.',
btnCaption: 'Kontynuuj przeglądanie'
},
//... you'll need to translate ALL the strings, see above for full list
},
}
};
</script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/tcf/stub.js"></script> <!-- IAB Transparency and Consent Framework -->
<script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script>
</head>
<body>
<header>
<div class="wrapper">
<h1>iubenda Cookie Solution</h1>
<p>i18n configuration</p>
</div>
</header>
<section class="wrapper">
<p>In this demo, we show you how to edit/translate the texts of any Cookie Solution component via the i18n JavaScript library.</p>
<h4>Customize the texts of supported languages</h4>
<p>Inside the <code>i18n</code> code section, you'll find a list of all editable components/strings you can use as a reference for your edits and localizations. In fact, aside from just localization, you can also use <code>i18n</code> to customize the texts of supported languages (such as English).</p>
<h4>Localize the cookie banner in an unsupported language</h4>
<p>If you want to translate the cookie banner in an unsupported language (e.g. Polish), you'll have to define:</p>
<ul>
<li>the <code>i18n</code> object with <strong>all</strong> the strings – see the code under <em>"<strong>some</strong> sample strings translated into an unsupported language (Polish)"</em></li>
</ul>
<p>and a couple of other parameters:</p>
<ul>
<li><code>lang: "pl"</code>, the language in which to display the content of the cookie banner</li>
<li><code>cookiePolicyUrl: "..."</code>, the cookie policy's URL linked within the banner. In this case, you'll have to provide a cookie-less page containing the cookie policy in Polish</li>
</ul>
<div class="note">
<ul>
<li>Remember to use your own credentials from <a href="https://www.iubenda.com/en/dashboard" target="_blank">your iubenda account</a></li>
<li>This is a sample for purely demonstrative purposes, <strong>no consents are saved</strong> (result of <code>_iub.csConfiguration.skipSaveConsent = true</code>). Just refresh the page to make the cookie banner reappear.</li>
</ul>
</div>
<h4>Helpful guides</h4>
<ul class="guides">
<li><a href="https://www.iubenda.com/en/help/1177" target="_blank">Cookie Solution - Getting Started</a></li>
<li><a href="https://www.iubenda.com/en/help/3831" target="_blank">How to Customize the Look and Behavior of the Cookie Banner (Beginner's Guide)</a></li>
<li><a href="https://www.iubenda.com/en/help/1205" target="_blank">How to Configure Your Cookie Solution (Advanced Guide)</a></li>
<li><a href="https://www.iubenda.com/en/help/3081" target="_blank">Introduction to the Prior Blocking of Cookies</a></li>
</ul>
</section>
</body>
</html>
//don't copy this JS (just for demo purposes)
//don't save consent, always show the banner
_iub.csConfiguration.skipSaveConsent = true;
Also see: Tab Triggers