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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!DOCTYPE html>
    <meta charset="UTF-8">
    <title>Default Setup</title>
    <link rel="stylesheet" href="css/reset.css" type="text/css">
    <link rel="stylesheet" href="css/styles.css" type="text/css">
  <div class="app-container">
    <button class="button">Click Here</button>
    <div id="app"></div>
    <script src=""></script>
    <script type="text/javascript" src="scripts/script.js"></script>



                *, *:before, *:after {
	margin: 0;
	padding: 0;

	-webkit-box-sizing: border-box !important;
	-moz-box-sizing: border-box !important;
	-ms-box-sizing: border-box !important;
	box-sizing: border-box !important;

body {
  font-size: 18px;
  box-sizing: border-box;
  font-family: roboto, sans-serif;

h1 {
  font-size: 2em;
  margin: 0.67em 0;

h2 {
  font-size: 1.5em;
  margin: 0.75em 0;

h3 {
  font-size: 1.17em;
  margin: 0.83em 0;

h5 {
  font-size: 0.83em;
  margin: 1.5em 0;

h6 {
  font-size: 0.75em;
  margin: 1.67em 0;

h1, h2, h3, h4, h5, h6 {
  font-weight: bolder;

.container {
  background-color: red;
  width: 100%;
  height: auto;

.one {
  height: 500px;
  text-align: center;

.two {
  margin: auto;

/* End of Custom CSS */

.app-container {
  width: 100%;
  height: auto;
  background-color: blueviolet;

.button {
  padding: 1em;
  border: 0;
  margin: 1.75em;
  border-radius: 500vh;
  font-size: 1.15em;
  font-style: bold;
  background: #da291c;
  color: white;
  box-shadow: 2px 5px 12px rgba(0,0,0, 0.7);
  transition: background 250ms ease-in-out, color 250ms ease-in-out, transform 250ms ease-in-out;

.button:hover {
  background: white;
  color: black;
  transform: scale(1.1);
  transition: background 250ms ease-in-out, color 250ms ease-in-out, transform 250ms ease-in-out;

.button:active {
  transform: translateY(3px);

.item {
  width: 80%;
  height: auto;
  padding: 1.25em;
  border: 2px solid black;
  margin: 0 auto;

.text-spacing {
  letter-spacing: 0.015em;


                //URL where API is requesting information from
const url= "";

//Set new headers
let h = new Headers();

//Send Request with authenticated API request 
let req = new Request(url, {
  method: "GET",
  headers: {
      "Content-Type": "application/json",
      "x-api-key": 'My_API_KEY' },
      mode: 'cors' });

//Select app
const selectApp = document.getElementById('app');

//Select button
const selectButton = document.querySelector('.button');

//Event listener to trigger when button is selected
selectButton.addEventListener('click', getData);

// Function to Fetch API Data and output to 
function getData() { fetch("")  
  .then((res) => res.json())
  .then((data) => {
    let array = data;
    let output = '';
    array.forEach(function(cat) {
      output +=`
        <div class="item">
        <h1>Name: ${}</h1>  
        <h3>Country of Origin: ${cat.origin}</h3> 
        <h3>Wiki URL: <a href="${cat.wikipedia_url}">Wiki URL</a></h3> 
        <h3>Description:<p><span class="text-spacing">${cat.description}</span></p></h3>
    selectApp.innerHTML = output;

// Function to get images, which is failing and returning 400 
function getImages(req) {
  .then((res) => res.json())
  .then((data) => {