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.
<header>
<div class="wrap">
<h1>This is a tooltiper. It works with <span class="tooltiper"data-tooltip="Just wrap your element in any html element with tooltiper class and add your content inside a data-tooltip attribute">data attribute</span></h1>
</div>
</header>
<section class="content">
<div class="wrap"><p><span class="tooltiper" data-tooltip="Siri, Google Now, Alexa, and Slackbots">Machine learning</span> techniques have progressed to the point where a new user interface is on the cusp of mass-market adoption: computer systems that understand enough natural human language to be useful and respond accordingly. Siri, Google Now, Alexa, and <span class="tooltiper" data-tooltip="Bla bla blabla bla bla bla">Slackbots</span> are a few high-profile examples of voice or message-driven experiences that have gained some level of real-world use. Indeed, these and other AI systems are now open enough, and of high-enough quality, <span class="tooltiper" data-tooltip="Siri, Google Now, Alexa, and Slackbots">to</span> allow brands to begin interacting with customers and prospects through natural language. The result is the beginning of a new era in customer relationships that promises to be every bit transformative as social media and mobile devices were in the last decade.
</p><p>In light of this, companies need to ask themselves one question: can your customers talk to your brand?
</p><h4>An Inflection Point for Natural Language.
</h4><p>Technology periodically forces a radical reshuffling of the mechanism in which brands build relationships with consumers. Mass marketing was born in the industrial revolution as supply outstripped demand for the first time, necessitating print advertising. Radio, television, and then cable TV were the next sequential developments, each allowing progressively broader, more targeted, and more impactful communications.
</p><p>The Internet revolution has brought us a radical change in people-to-brand communications roughly once each decade. First, the very idea of a website was novel, and 1995 saw a shift from call center and direct mail to web. The mid-aughts brought us the mobile and social revolution, where no brand communication strategy was complete without vibrant social media channels, mobile apps, and mobile web presence—indeed, today it is rare that a company is not mobile-first in its communications strategy.
</p><p>Customer-service solutions have toyed with automated phone and email responses-- to much consumer frustration--for a generation, but the mid-teens mark an inflection point in machine learning as it relates to natural language. Finally, computer systems can translate the unstructured data of human speech and reliably convert it into structured data. This structured data can then be processed like any other data input by a user, allowing the computer to perform actions and generate a natural language response. The result: real-world applications of natural language interfaces are ready for prime time. These natural language—or conversational—interfaces can be by voice or text, accessible by speaking into a microphone or typing into a text box.
</p><p>More excitingly, the leading conversational interface platforms are, allowing third-party development of “conversational apps.” Alexa, Siri, Google Now, iMessage, and Slack are a few of the long list of conversational interface platforms that do, or will soon, allow the development of third-party applications. And, artificial intelligence platforms such as api.ai and Microsoft Cognitive Services simplify the development of conversational apps, standardizing natural language processing and simplifying access to conversational platforms.
</p></div>
</section>
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,700');
* {
margin:0;
padding:0;
outline:none;
list-style:none;
text-decoration:none;
box-sizing:border-box;
color:#111;
background: transparent;
border:none;
}
body {
background: #f3f3f3;
font-family: 'Montserrat', sans-serif;
}
h1, h2, h3 {
font-family: 'Montserrat', sans-serif;
font-weight: 700;
}
.wrap {
width: 90%;
max-width: 1024px;
margin: 0 auto;
position: relative;
top: 50%;
transform: translateY(-50%);
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
}
header {
height: 450px;
background: #fff;
text-align: center;
}
header h1 {
font-size: 72px;
}
.content .wrap {
padding-right: 300px;
top: 100px;
transform: none;
-moz-transform: none;
-webkit-transform: none;
}
.content .wrap p {
margin-bottom: 30px;
line-height: 1.8em;
}
.tooltiper {
position: relative;
display: inline-block;
color: rgba(126, 0, 255,0.9);
}
/* tooltiper css */
.tooltiper {
position: relative;
z-index: 3;
}
.tooltiper .tooltip {
position: absolute;
font-size: 0.7rem;
text-align: left;
background: rgba(126, 0, 255,0.9);
color: white;
padding: 5px 10px;
border-radius: 5px;
display: block;
top: -30px;
left: 50%;
height: 0;
transform: translateX(-50%) translateY(50%);
-webkit-transform: translateX(-50%) translateY(50%);
-o-transform: translateX(-50%) translateY(50%);
line-height: 1.4em;
opacity: 0;
transform-origin: top;
transition: transform 0.2s ease-out, opacity 0.1s ease-out 0.1s;
-webkit-transition: transform 0.2s ease-out, opacity 0.1s ease-out 0.1s;
-o-transition: transform 0.2s ease-out, opacity 0.1s ease-out 0.1s;
}
.tooltiper:hover .tooltip {
opacity: 1;
height: auto;
transform: translateX(-50%) translateY(0);
-webkit-transform: translateX(-50%) translateY(0);
-o-transform: translateX(-50%) translateY(0);
transition: transform 0.2s ease-out, opacity 0.1s ease-out;
-webkit-transition: transform 0.2s ease-out, opacity 0.1s ease-out;
-o-transition: transform 0.2s ease-out, opacity 0.1s ease-out;
}
.tooltiper .tooltip:after {
left: calc(50% - 4px);
top: calc(100% + 4px);
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.tooltiper .tooltip:after {
border-color: transparent;
border-top-color: rgba(126, 0, 255,0.9);
border-width: 4px;
margin-top: -4px;
}
var elements = '';
$(document).ready(function(){
toolTiper('.tooltiper');
});
var eLtop = '';
var eLleft = '';
var eLtw = '';
var eLth = '';
var eLcontent= '';
function toolTiper(elements) {
$(elements).each(function(){
var eLcontent = $(this).attr('data-tooltip');
var eLtop = $(this).position().top;
var eLleft = $(this).position().left;
$(this).append('<span class="tooltip">'+eLcontent+'</span>');
var eLtw = $(this).find('.tooltip').width(),
eLth = $(this).find('.tooltip').height();
console.log(eLtw);
$(this).find('.tooltip').css({
"top": (0 - eLth)+'px'
});
});
}
Also see: Tab Triggers