Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <h1>Physical vs. logical properties</h1>

<h2>Physical properties</h2>

<p>In right-to-left languages “One” should be positioned at the very right, but it's not because with physical properties every list item has its margin always on the right, no matter the reading direction.</p>

<h3>left to right</h3>
<ul class="physical">
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ul>

<h3>right to left</h3>
<ul class="physical" dir="rtl">
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ul>


<h2>Logical properties</h2>

<p>Using logical properties, “One” is at the very right in right-to-left languages because logical properties don't work with the concept of <em>top</em> and <em>bottom</em> or <em>left</em> and <em>right</em>, but <em>start</em> and <em>end</em>, which may switch depending on the writing mode.

<h3>left to right</h3>
<ul class="logical">
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ul>

<h3>right to left</h3>
<ul class="logical" dir="rtl">
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ul>
              
            
!

CSS

              
                ul {
  display: flex;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0 0 2rem 0;
  max-width: 30rem;
  border: 2px solid;
}

.physical li {
  margin-right: 2rem;
}

.logical li {
  margin-inline-end: 2rem;
}








body {
  font-family: sans-serif;
  font-size: 1.4rem;
  max-width: 75ch;
  line-height: 1.5;
}
              
            
!

JS

              
                
              
            
!
999px

Console