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.


This is an simple example of a leaflet map for an organization website.
Simply replace the css and javascript variables or make it your own !

<section class="map" id="map">


                :root {
  --color-primary: peru;
  --logo: url(;

.map {
  height: 100vh;
  min-height: 350px;
  position: relative;

  .logo {
    // the marker icon
    mask: url("data:image/svg+xml,%3Csvg xmlns='' viewBox='0 0 62.5 100'%3E%3Cpath d='M53.3 9.2A31.26 31.26 0 009.1 53.4s22.1 21.7 22.1 46.7c0-25 22.1-46.7 22.1-46.7 12.3-12.2 12.3-32 0-44.2zM31.2'/%3E%3C/svg%3E%0A");
    background-color: var(--color-primary);
    background-size: contain;
    background-repeat: no-repeat;
    position: relative;

    // the company logo
    &::before {
      box-sizing: border-box;
      content: "";
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      background-image: var(--logo);
      background-color: var(--color-primary);
      background-size: cover;
      background-repeat: no-repeat;
      border-radius: 50%;
      width: 45px;
      height: 45px;
      border: 2px solid var(--color-primary);

.leaflet-popup-content {
  padding: 0.5rem;
  line-height: 1.8;
  position: relative;
  z-index: 1;
  min-width: 200px;
  font-size: 0.9rem;
  font-family: inherit;

  h3 {margin: 0 0 0.5rem;}
  p {margin: 0;}

  .links {margin-top: 0.5rem;}
  a {
    color: var(--color-primary);
    padding-right: 1rem;

.leaflet-container a.leaflet-popup-close-button {
  padding: 0.8rem;
  z-index: 1;



                const options = {
  coordinates: [40, 40],
  name: "Unicorn Company",
  adress: "123 whatever boulevard",
  postalCode: "000000",
  city: "Bear town",
  website:  ["", " →"],
  socialMedia: ["", "Linkedin →"]

// Defining the map
let map ="map", {
  center: options.coordinates,
  zoom: 9,
  scrollWheelZoom: false

// Basemap config
L.tileLayer("https://{s}{z}/{x}/{y}.png", {
  'Map tiles by <a href="">CartoDB</a> | Map data &copy; <a href="">OpenStreetMap</a> contributors'

// Setting the company logo as a custom icon
let myIcon = L.divIcon({
  className: "logo",
  iconSize: [45, 72],
  iconAnchor: [22.5, 72],
  popupAnchor: [0, -72]

// adding the marker
L.marker(options.coordinates, { icon: myIcon })
      <p>${options.postalCode}, ${}</p>
      <div class="links">
        <a href="${[0]}">${[1]}</a>
        <a href="${options.socialMedia[0]}">${options.socialMedia[1]}</a>