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

              
                <!--
    Sass/SCSS範例網頁(HTML)
    By 萌芽系列網站 ‧ Mnya Series Website ‧ Mnya.tw
-->

<div id="box">
  <div class="box1">
    <div class="title">標題一</div>
    內文1:正體中文測試。
  </div>
  <div class="box2">
    <div class="title">標題二</div>
    內文2:HELLO WORLD!
  </div>
  <div class="box3">
    <div class="title">標題三</div>
    內文3:萌芽網頁 MNYA.TW
  </div>
</div>
              
            
!

CSS

              
                /*
    Sass/SCSS範例網頁(SCSS)
    By 萌芽系列網站 ‧ Mnya Series Website ‧ Mnya.tw
*/

/* $ 變數 */

$box1-bgcolor: #8200c3;
$box2-bgcolor: #7d6400;
$box3-bgcolor: #00a56e;
$switch-bgcolor: true;
/* 變色開關:true=開啟, false=關閉 */
$box-color: #fff;
$padding: 2px;

/* @mixin 函數 */

@mixin transition($property, $period) {
  -webkit-transition: $property #{$period}s ease;
  -moz-transition: $property #{$period}s ease;
  -ms-transition: $property #{$period}s ease;
  -o-transition: $property #{$period}s ease;
  transition: $property #{$period}s ease;
}

@mixin border-radius($radius) {
  border-radius: $radius;
  -webkit-border-radius: $radius;
  -moz-border-radius: $radius;
}

/* 開始 */

#box {
  display: flex;
  margin: 5px;
  color: $box-color;
}

.box {
  width: 200px;
  height: 250px;
  margin: 5px 8px;
  padding: $padding * 5;
  background: #181818;
  font: Arial, "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 22px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  @include border-radius(10px);
  @include transition(all, 0.5);

  .title {
    margin: 3px;
    padding-left: $padding * 4;
    font-size: 20px;
    line-height: 28px;
    border-left: 8px $box-color solid;
    color: $box-color;
    @include transition(all, 0.3);
  }

  &:hover {
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.8);

    .title {
      border-left: 12px $box-color solid;
    }
  }
}

$list: 1 2 3;

@each $box-num in $list {
  .box#{$box-num} {
    @extend .box;
  }
}

@if $switch-bgcolor==true {
  .box1 {
    background: $box1-bgcolor;
  }

  .box2 {
    background: $box2-bgcolor;
  }

  .box3 {
    background: $box3-bgcolor;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console