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.


                <p id="result"></p>




                window.onload = function() {
  os_by_fonts = getOSbyFonts();
  document.getElementById("result").innerHTML = os_by_fonts;

//функция детекта ОС по шрифтам
function getOSbyFonts() {
  var fonts = ["Impact", "Lucida Console", "Lucida Grande", "Lucida Sans Unicode", "Verdana", "Geneva", "Webdings", "MS Serif", "Tahoma", "Trebuchet MS", "Palatino Linotype", "Palatino", "Apple Symbols"];
  var macf = [true, false, true, true, true, true, false, false, true, true, true, true, true];
  var winf = [true, true, false, true, true, false, true, true, true, true, true, false, false];
  var count = 0;
  var mcount = 0;
  var wcount = 0;
  for (var i = 0; i < fonts.length; ++i) {
    if (macf[i] == doesFontExist(fonts[i])) mcount++;
    if (winf[i] == doesFontExist(fonts[i])) wcount++;
    if (doesFontExist(fonts[i])) {
    } else {
  var os_by_fonts = "Not detected";
  if (mcount > wcount) os_by_fonts = "Mac";
  else if (mcount < wcount) os_by_fonts = "Windows";
  if (count < 0) os_by_fonts = "Linux/Unix";
  return os_by_fonts;

//функция, определляющая наличие шрифта в системе
function doesFontExist(fontName) {
  var canvas = document.createElement("canvas");
  var context = canvas.getContext("2d");
  var text = "abcdefghijklmnopqrstuvwxyz0123456789";
  context.font = "72px monospace";
  var baselineSize = context.measureText(text).width;
  context.font = "72px '" + fontName + "', monospace";
  var newSize = context.measureText(text).width;
  delete canvas;
  if (newSize == baselineSize) {
      return false;
  } else {
      return true;