Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <body>
  <main>
      <aside>
        <div id="presentServeur">
          <p>Nemo quaeso miretur, si post exsudatos labores itinerum longos congestosque adfatim commeatus fiducia vestri ductante barbaricos pagos adventans velut mutato repente consilio ad placidiora deverti.</p>
        </div>
        <div id="presentCarte">
          <p>Post quorum necem nihilo lenius ferociens Gallus ut leo cadaveribus pastus multa huius modi scrutabatur. quae singula narrare non refert, me professione modum, quod evitandum est, excedamus.</p>
          <p>Et est admodum mirum videre plebem innumeram mentibus ardore quodam infuso cum dimicationum curulium eventu pendentem. haec similiaque memorabile nihil vel serium agi Romae permittunt. ergo redeundum ad textum.</p>
        </div>
      </aside>
      <section>
        <div id="map"></div>
      </section>
    </main>
</body>
              
            
!

CSS

              
                main {
  display: flex;
  flex-flow: row nowrap;
}

main aside {
  flex: 1 1 30%;
}

main section {
  position: relative; /* important pour pouvoir placer la div map en absolute */
  flex: 1 1 70%;
	flex-flow: row nowrap;
}

#map {
  position: absolute;
  top:0;
  left:0;
  height:100%;
  width:100%;
}

/* Responsive */

@media all and (max-width: 640px) {
  main { flex-flow: column nowrap; }
  main section { min-height: 400px; }
}

/* Decoration */

main aside {
  padding: 10px;
  background-color: #EE3268;
  color: white;
}
main section {
	margin: 0;
  padding: 10px;
	background-color: #A27FB7;
}

#map {
  border-radius: 20px;
  overflow: hidden;
}
              
            
!

JS

              
                var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM()
    })
  ],
  target: 'map',
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});
              
            
!
999px

Console