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.


                <div class="container">
  <p>In the following example, the space between the image and the text is set using a logical margin property <code>margin-inline-end</code>. We don't need to set the left nor the right margin for each case, the rule will work for both according to the direction of the block.</p>
  <div class="block-container block-container--en">
    <p><img src="" alt="" /> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum egestas nisl ac placerat finibus. Nunc accumsan arcu leo, mollis rhoncus mi lacinia sollicitudin. Sed vestibulum convallis aliquet. Aenean pellentesque placerat massa, eget bibendum ligula dictum in.</p>

  <div class="block-container block-container--ar">
    <p><img src="" alt=""> لوريم إيبسوم(Lorem Ipsum) هو ببساطة نص شكلي (بمعنى أن الغاية هي الشكل وليس المحتوى) ويُستخدم في صناعات المطابع ودور النشر. كان لوريم إيبسوم ولايزال المعيار للنص الشكلي منذ القرن الخامس عشر عندما قامت مطبعة مجهولة برص مجموعة من الأحرف بشكل عشوائي أخذتها من نص، لتكوّن كتيّب بمثابة دليل أو مرجع شكلي لهذه الأحرف. خمسة قرون من الزمن لم تقضي على هذا النص، بل انه</p>


                body {
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.6;

.container {
  max-width: 600px;
  margin: 0 auto;

.block-container {
  border: 1px solid #ccc;
  padding: 15px;
  margin: 10px 0;

.block-container--en {
  direction: ltr;

.block-container--ar {
  direction: rtl;

img {
  width: 100px;
  margin-inline-end: 15px;

.block-container--en img {
  float: left;

.block-container--ar img {
  float: right;

code {
  background: #eee;
  padding: 5px;