cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

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.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              <div id="info-container" class="info-container">
	<div><i id="times" class="fas fa-times"></i></div>
	<p id="info" class="info">Hover (click for mobile) over the <code>sup</code> and <code>sub</code> elements to reveal a tooltip.</p>
<div class="card">
	<p class="symbol">H<sub data-tooltip="Two atoms of hydrogen.">2</sub>O</p>
	<p><strong>H<sub data-tooltip="Two atoms of hydrogen.">2</sub>O</strong> is the chemical formula for water, ice or steam which consists of <strong>two atoms of hydrogen</strong> and <strong>one atom of oxygen</strong>.</p>
	<p>Water is a <strong>transparent</strong>, <strong>tasteless</strong>, <strong>odorless</strong>, and <strong>nearly colorless</strong> chemical substance that is the main constituent of Earth's streams, lakes, and oceans, and the fluids of most living organisms.</p>
	<p>Water covers <strong>71%</strong> of the Earth's surface.<sup data-tooltip="1. CIA – The world factbook. Central Intelligence Agency. Retrieved 20 December 2008.">1</sup> It is vital for all known forms of life.</p>
	<p class="footnote">1. <a target="_blank" href="https://www.cia.gov/library/publications/the-world-factbook/geos/xx.html#Geo">CIA – The world factbook. Central Intelligence Agency. Retrieved 20 December 2008</a></p>
<!-- https://www.cia.gov/library/publications/the-world-factbook/geos/xx.html#Geo	 -->
	<div class="element">
		<a href="#"><i class="fas fa-arrow-left"></i></a>
		<p class="element-name">Water</p>
		<a href="#"><i class="fas fa-arrow-right"></i></a>
              html {
	box-sizing: border-box;
*:after {
	box-sizing: inherit;
body {
	font-family: 'Work Sans', sans-serif;
	font-weight: 300;
	margin: 30px 0;
	background: #20A4F3;
	position: relative;
	background-image: url('https://s3.amazonaws.com/graphics-jaymie/sea-creatures.png');
	background-size: cover;
a {
	text-decoration: none;
	color: grey;
p {
	font-size: 14px;
	color: grey;
	line-height: 1.6em;
strong {
	font-weight: bold;
div.info-container {
	max-width: 350px;
	border-radius: 10px;
	padding: 20px;
	margin: 0 auto 30px auto;
	background: rgba(255,255,255,0.9);
p.info {
	font-size: 12px;
p.symbol {
	margin: 0;
	font-family: 'Abril Fatface', serif;
	font-size: 40px;
	color: #20A4F3;
	text-align: center;
p.element-name {
	display: inline;
	margin: 0 70px;
i.fas.fa-times {
	color: #20A4F3;
p.footnote {
	font-size: 10px;
div.card {
	padding: 20px;
	background: rgba(255, 255, 255, 0.9);
	height: 475px;
	border-radius: 10px;
	margin: 0 auto;
	max-width: 350px;
	position: relative;
/* 	box-shadow: 0px 0px 20px 2px #7FB7BE; */
div.element {
	text-align: center;
	background: #e1e2de;
	color: grey;
	padding: 15px;
	position: absolute;
	bottom: 0;
	left: 0;
	border-radius: 0 0px 10px 10px;
	width: 100%;
i.fas.fa-arrow-right {
	display: inline-block;
/* thank you: https://codepen.io/jaymierosen/pen/vjwONj */
/* Tooltip Styles */
/* Add this attribute to the element that needs a tooltip */
[data-tooltip] {
	position: relative;
	z-index: 2;
	cursor: pointer;
/* Hide the tooltip content by default */
[data-tooltip]:after {
	visibility: hidden;
	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
	filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=0);
	opacity: 0;
	pointer-events: none;
/* Position tooltip above the element */
[data-tooltip]:before {
	position: absolute;
	bottom: 150%;
	left: 50%;
	margin-bottom: 5px;
	margin-left: -80px;
	padding: 7px;
	width: 150px;
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	border-radius: 3px;
	background-color: #000;
	background-color: #D65780;
	color: #fff;
	content: attr(data-tooltip);
	text-align: center;
	font-size: 14px;
	line-height: 1.2;
/* Triangle hack to make tooltip look like a speech bubble */
[data-tooltip]:after {
	position: absolute;
	bottom: 150%;
	left: 50%;
	margin-left: -5px;
	width: 0;
	border-top: 5px solid #000;
	border-top: 5px solid #D65780;
	border-right: 5px solid transparent;
	border-left: 5px solid transparent;
	content: " ";
	font-size: 0;
	line-height: 0;
/* Show tooltip content on hover */
[data-tooltip]:hover:after {
	visibility: visible;
	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
	filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=100);
	opacity: 1;

              const times = document.getElementById('times');
const iconContainer = document.getElementById('info-container');
// let infoP = document.getElementById('info');
times.onclick = function() {
function click() {
	iconContainer.style.display = 'none';
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................