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 URLs 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 its URL and the proper URL extension.
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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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 lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UX and Digital Advertising Case Study</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>Revolutionizing Advertising UX Design with ChatGPT<br>Tea Reale</h1>
</header>
<main>
<section>
<h2>Introduction</h2>
<p>Today's digital landscape relies heavily on advertisements to generate revenue, making it essential to incorporate robust UX practices to craft ads that resonate effectively.</p>
<p>This design/illustrative case study delves into the intricate dynamics between user experience (UX) and digital advertising, focusing on enlightening effective strategies for optimizing ad delivery while prioritizing user satisfaction and experience.</p>
</section>
<section>
<h2>Project Summary</h2>
<p>In today's fast-paced digital world, consumers are bombarded with advertising messages daily, leading to a common issue known as ad fatigue. Understanding user behavior in the digital landscape is crucial for digital marketing efforts; it is the key to comprehending how customers think, act, and engage with brands and digital products.</p>
</section>
<section>
<h2>Problem Statement</h2>
<p>Digital advertising faces a significant hurdle as users increasingly install ad blockers due to the annoyance, intrusiveness, and disruption caused by poorly designed ads.</p>
</section>
<section>
<h2>User Interviews</h2>
<p>The survey results, based on responses from 10 participants, reveal significant insights into users' attitudes and behaviors towards online advertising. Most respondents strongly agree that intrusive or annoying ad experiences can deter them from purchasing from a brand.</p>
</section>
<section>
<h2>Pain Points</h2>
<ul>
<li>Intrusive Ads Deterring Purchases</li>
<li>High Ad Blocker Adoption</li>
<li>Dislike for Interruptions on Publisher Pages</li>
<li>Preference for Non-disruptive Ad Placement</li>
<li>Banner Blindness and Ignored Ads</li>
</ul>
</section>
<section>
<h2>User Persona</h2>
<p>Two different user personas have been created for this case study. Sarah and Michael represent different stakeholders within the digital advertising ecosystem.</p>
</section>
<section>
<h2>Design Solutions</h2>
<p>Based on findings from various authors, design solutions have been analyzed to address the identified pain points and improve the user experience in digital advertising.</p>
</section>
<section>
<h2>How to Make Pop-Ups Work</h2>
<p>Pop-ups have a bad reputation because they are often used poorly. They appear unexpectedly, too frequently, are irrelevant, obstructive, and difficult to dismiss, causing frustration among users. Despite this, pop-ups can be effective if used correctly. Here are eight golden rules for making pop-ups more acceptable and palatable:</p>
<ul>
<li><strong>Wait for Interest</strong>: Show pop-ups only after visitors have shown interest in a topic.</li>
<li><strong>Relevance</strong>: Ensure the pop-up is relevant to the content being viewed.</li>
<li><strong>Delay Display</strong>: Do not show pop-ups immediately; wait for a delay or user interaction.</li>
<li><strong>Non-Obtrusive</strong>: Keep pop-ups small and avoid covering the entire page.</li>
<li><strong>Avoid Overlays</strong>: Do not use shading overlays that cover the entire screen.</li>
<li><strong>Respect Dismissals</strong>: If a pop-up is dismissed, do not show it again immediately.</li>
<li><strong>No Redundancy</strong>: Do not ask users to subscribe or download something they already have.</li>
<li><strong>Low Risk</strong>: Make interactions with pop-ups feel low-risk with less intimidating buttons.</li>
</ul>
<p>Pop-ups, if used correctly, can still be a valuable tool for engagement. They should be designed to enhance user experience, not disrupt it.</p>
<p><em>Reference: Forbes Baxter Associates, n.d.</em></p>
</section>
</main>
<div id="popup" class="popup" role="dialog" aria-labelledby="popup-title" aria-describedby="popup-description">
<div class="popup-content">
<button class="close" onclick="closePopup()" aria-label="Close">×</button>
<h2 id="popup-title">Ads that Understand You</h2>
<h4 id="popup-description">Enhance your browsing experience with personalized, non-intrusive ads.</h4>
<p>Tired of annoying ads? Our AI-driven approach ensures you see relevant ads that appear only after you've engaged with content. Say goodbye to ad fatigue and hello to a better browsing experience.</p>
<button class="learn-more">Learn More</button>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
body {
font-family: 'Arial', sans-serif;
background-color: #ECF0F1; /* Light Gray */
margin: 0;
padding: 0;
color: #333; /* Dark Gray */
}
header {
background-color: #5B2C6F; /* Dark Purple */
color: white;
padding: 20px;
text-align: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
main {
padding: 20px;
max-width: 800px;
margin: 20px auto;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h1, h2 {
color: #9B59B6; /* Purple */
}
section {
margin-bottom: 40px;
}
.popup {
display: none; /* Hidden by default */
position: fixed;
z-index: 1;
bottom: 20px;
right: 20px;
width: 300px;
background-color: #fff; /* White */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
border-radius: 10px;
padding: 20px;
animation: fadeIn 0.5s ease-in-out;
}
.popup-content {
text-align: center;
}
.close {
background: none;
border: none;
color: #616A6B; /* Gray */
float: right;
font-size: 28px;
font-weight: bold;
cursor: pointer;
}
close:hover,
.close:focus {
color: #000; /* Black */
text-decoration: none;
outline: none;
}
h2 {
color: #9B59B6; /* Purple */
font-size: 20px;
font-weight: bold;
}
h4 {
color: #5B2C6F; /* Dark Purple */
font-size: 16px;
font-weight: normal;
}
p {
color: #333; /* Dark Gray */
font-size: 14px;
margin: 20px 0;
}
.learn-more {
background-color: #D7BDE2; /* Light Purple */
color: #000; /* Black */
border: none;
padding: 10px 20px;
font-size: 14px;
font-weight: bold;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.learn-more:hover {
background-color: #9B59B6; /* Purple */
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
window.onload = function() {
// Wait for the user to scroll down 25% of the page or spend 5 seconds on the page
setTimeout(showPopup, 5000); // Show pop-up after 5 seconds
window.onscroll = function() {
if (document.documentElement.scrollTop > document.documentElement.scrollHeight / 4) {
showPopup();
}
};
// Exit-Intent trigger
document.addEventListener('mouseout', function(event) {
if (!event.toElement && !event.relatedTarget && event.clientY < 10) {
showPopup();
}
});
};
function showPopup() {
document.getElementById('popup').style.display = 'block';
document.getElementById('popup').setAttribute('aria-hidden', 'false');
}
function closePopup() {
document.getElementById('popup').style.display = 'none';
document.getElementById('popup').setAttribute('aria-hidden', 'true');
}
Also see: Tab Triggers