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 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.
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/sankey.js"></script>
<script src="https://code.highcharts.com/modules/organization.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container"></div>
#container {
min-width: 500px;
margin: 1em auto;
border: 1px solid silver;
}
button {
border: 1px solid #1da1f2;
border-color: #0084B4;
border-radius: 100px;
font-size: 20px;
}
#button-bar {
text-align: center;
}
#container{
text-transform: none;
font-size: 14px;
font-weight: normal;
}
h4 {
font-size: 9.5px !important;
}
@media (min-width: 576px) {
h4 {
font-size: 12px !important;
}
}
@media (min-width: 768px) {
h4 {
font-size: 12.5px !important;
}
}
@media (min-width: 992px) {
h4 {
font-size: 15px !important;
}
}
@media (min-width: 1200px) {
h4 {
font-size: 18px !important;
}
}
var chart = Highcharts.chart('container', {
chart: {
height: 600,
inverted: false
},
title: {
text: 'Carnivora Phylogeny'
},
plotOptions: {
series: {
nodeWidth: '22%'
}
},
series: [{
type: 'organization',
name: 'Highsoft',
keys: ['from', 'to'],
data: [
['Carnivora', 'Felidae'],
['Carnivora', 'Mustelidae'],
['Carnivora', 'Canidae'],
['Felidae', 'Panthera'],
['Mustelidae', 'Taxidea'],
['Mustelidae', 'Lutra'],
['Panthera', 'Panthera pardus'],
['Taxidea', 'Taxidea taxus'],
['Lutra', 'Lutra lutra'],
['Canidae', 'Canis'],
['Canis', 'Canis latrans'],
['Canis', 'Canis lupus']
],
levels: [{
level: 0,
color: '#DEDDCF',
borderLine: 10,
dataLabels: {
color: 'black'
}
}, {
level: 1,
color: '#DEDDCF',
dataLabels: {
color: 'black'
},
height: 25
}, {
level: 2,
color: '#DEDDCF',
dataLabels: {
color: 'black'
},
}, {
level: 3,
dataLabels: {
color: 'black'
},
}],
nodes: [{
id: 'Carnivora',
title: null,
name: 'Carnivora',
info: "Carnivora is a diverse scrotiferan order that includes over 280 species of placental mammals."
}, {
id: 'Felidae',
title: null,
name: 'Felidae',
color: "#fcc657",
info: "Felidae is a family of mammals in the order Carnivora, <br>colloquially referred to as cats, and constitute a clade."
}, {
id: 'Panthera',
title: null,
name: 'Panthera',
color: "#fcc657",
info: "Panthera"
}, {
id: 'Panthera pardus',
title: null,
name: 'Panthera pardus',
color: "#fcc657",
image: "https://raw.githubusercontent.com/mekhatria/demo_highcharts/master/panthera.png",
info: "Panthera is a genus within the Felidae family <br>that was named and described by Lorenz Oken in 1816 <br>who placed all the spotted cats in this group."
}, {
id: 'Mustelidae',
title: null,
name: 'Mustelidae',
color: "#C4B1A0",
info: "The Mustelidae are a family of carnivorous mammals,<br> including weasels, badgers, otters, ferrets, martens, mink, and wolverines, among others."
}, {
id: 'Taxidea',
title: null,
name: 'Taxidea',
color: "#C4B1A0",
info: "Taxidea"
}, {
id: 'Lutra',
color: "#C4B1A0",
info: "Lutra"
}, {
id: 'Taxidea taxus',
name: 'Taxidea taxus',
color: "#C4B1A0",
image: "https://raw.githubusercontent.com/mekhatria/demo_highcharts/master/taxideaTaxus.png",
info: "Taxidea taxus is a North American badger, <br>somewhat similar in appearance to the European badger, <br>although not closely related. <br>It is found in the western and central United States, <br>northern Mexico, and south-central Canada to certain areas of southwestern British Columbia."
}, {
id: 'Lutra lutra',
name: 'Lutra lutra',
color: "#C4B1A0",
image: "https://raw.githubusercontent.com/mekhatria/demo_highcharts/master/lutra.png",
info: "Lutra is a semiaquatic mammal native to Eurasia. <br>The most widely distributed member of the otter subfamily (Lutrinae) of the weasel family (Mustelidae), <br>it is found in the waterways and coasts of Europe, many parts of Asia, <br>and parts of northern Africa."
}, {
id: 'Canidae',
name: 'Canidae',
color: "#B0ACA2",
info: "The biological family Canidae is a lineage of carnivorans <br>that includes domestic dogs, wolves, coyotes, foxes, jackals, dingoes, <br>and many other extant and extinct dog-like mammals. "
}, {
id: 'Canis',
name: 'Canis',
color: "#B0ACA2",
info: "Canis"
}, {
id: 'Canis latrans',
name: 'Canis latrans',
color: "#B0ACA2",
image: "https://raw.githubusercontent.com/mekhatria/demo_highcharts/master/canisLatrans.png",
info: "Canis latrans, is a canine native to North America.<br> It is smaller than its close relative, the gray wolf, and <br>slightly smaller than the closely related eastern wolf and red wolf."
}, {
id: 'Canis lupus',
name: 'Canis lupus',
color: "#B0ACA2",
image: "https://raw.githubusercontent.com/mekhatria/demo_highcharts/master/canisLupus.png",
info: "Canis lupus is a canine native to the wilderness and remote areas of Eurasia and North America. <br>It is the largest extant member of its family, with males averaging 43–45 kg (95–99 lb) <br>and females 36–38.5 kg (79–85 lb)."
}],
colorByPoint: false,
borderColor: 'white'
}],
tooltip: {
outside: true,
formatter: function() {
return this.point.info;
}
},
exporting: {
allowHTML: true,
sourceWidth: 800,
sourceHeight: 600
}
});
Also see: Tab Triggers