Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource


Babel includes JSX processing.

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


Add Packages

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.


Auto Save

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.


  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link href="" rel="stylesheet">
  <link href="style.css" rel="stylesheet" />
  <link href="" rel="stylesheet">

  <div id="root"></div>
  <script src="scripts.js"></script>


                body {
  text-align: center;
  color: #355070;
  font-family: "Roboto", sans-serif;
  background-color: #eaac8b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23e56b6f' fill-opacity='0.26'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");

h1 {
  font-family: "Permanent Marker", cursive;
  font-size: 4em;
  color: #b56576;

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  flex-direction: row-reverse;

.name {
  font-weight: bold;
.location {
  font-size: 0.8em;
  color: #6d597a;
.card {
  display: flex;
  justify-content: space-evenly;
  padding: 1em;
  margin: 1rem;
  border-radius: 5px;
  background: #fff;
  width: 200px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);

.greeting {
  animation: slideIn 2s;

@keyframes slideIn {
  0% {
    transform: translateX(0);
  50% {
    transform: translateX(100px);
  100% {
    transform: translateX(0);

.card:hover {
  transform: rotate(-5deg);

.card img {
  margin-left: 1em;
  border-radius: 50%;
  max-width: 50px;



                const app = document.getElementById("root");

const header = document.createElement("h1");
header.textContent = "Friends!";
header.setAttribute("class", "greeting");

const container = document.createElement("div");
container.setAttribute("class", "container");

const people = fetch("")
  .then((response) => {
    return response.json();
  .then((data) => {
    data.results.forEach((person) => {
      const card = document.createElement("div");
      card.setAttribute("class", "card");

      const { name, location } = person;

      const p = document.createElement("p");

      p.textContent = `${name.first}`;

      p.setAttribute("class", "name");
      const p2 = document.createElement("p");
      p2.textContent = `🏡 ${location.state}`;

      p2.setAttribute("class", "location");
      const img = document.createElement("img");
      img.src = person.picture.medium;

      const textContainer = document.createElement("div");

      const imgContainer = document.createElement("div");
  .catch((err) => console.log(err.toString()));