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.


                <h1>object-fit &amp; object-position</h1>


  <figcaption>object-fit: fill(initial)</figcaption>
  <img class="object-fit-fill" src="//" alt>

  <figcaption>object-fit: contain</figcaption>
  <img class="object-fit-contain" src="//" alt>

  <figcaption>object-fit: cover</figcaption>
  <img class="object-fit-cover" src="//" alt>

  <figcaption>object-fit: none</figcaption>
  <img class="object-fit-none" src="//" alt>

  <figcaption>object-fit: scale-down(smallest one of none or contain)</figcaption>
  <img class="object-fit-scale-down" src="//" alt>


  <figcaption>object-position: 50% 50%(initial)</figcaption>
  <img class="object-position-initial object-fit-contain" src="//" alt>

  <figcaption>object-position: 80px 160px</figcaption>
  <img class="object-position-length object-fit-contain" src="//" alt>

  <figcaption>object-position: top</figcaption>
  <img class="object-position-keyword object-fit-contain" src="//" alt>


                figure { 
  display: inline-block; 
  margin: 16px;
figcaption { 
  font-size: 20px;
  font-weight: 700; 
img[class^='object'] {
    linear-gradient(45deg, silver 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, silver 25%),
    linear-gradient(-45deg, silver 25%, transparent 25%),
    linear-gradient(-45deg, transparent 75%, silver 75%);
  background-size: 20px 20px;
  background-position: 0 0, -10px 10px, 0 -10px, 10px 0;
  width: 240px;
  height: 240px;

/* object-fit */
.object-fit-fill { object-fit: fill; } /* 초깃값, 채우기, 비율 무시 */
.object-fit-contain { object-fit: contain; } /* 포함하기, 넘치지 않음, 비율 유지 */
.object-fit-cover { object-fit: cover; } /* 채우기, 넘침, 비율 유지 */
.object-fit-none { object-fit: none; } /* 원본 크기와 비율로 노출하기 */
.object-fit-scale-down { object-fit: scale-down; } /* none | contain 중에서 작은 크기로 표시 */

/* object-position */
.object-position-initial { object-position: 50% 50%; } /* 초깃값, 가운데 */
.object-position-length { object-position: 80px 160px; } /* <length-percentage> */
.object-position-keyword { object-position: top; } /* keyword */