Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

HTML

              
                .container
  .block.a
    h4 RWD實作-重新排版原理-特定條件css-media query
    img.icon(src="https://hahow.in/static/media/logo-black.59fdbe30.svg", alt="這是圖片")
  .block.intro
    .sblocks
      .sblock
        img
        h5 標題1
      .sblock
        img
        h5 標題2
      .sblock
        img
        h5 標題3
  
  .block.b
    h4 B
    p 這邊是內文這邊是內文這邊是內文這邊是內文
  .block.c
    h4 C
    p 這邊是內文這邊是內文這邊是內文這邊是內文
  .block.d
    h4 D
    p 這邊是內文這邊是內文這邊是內文這邊是內文
  .block.e
    h4 E
    p 這邊是內文這邊是內文這邊是內文這邊是內文
  .block.f
    h4 F
    p 這邊是內文這邊是內文這邊是內文這邊是內文
  .block.g
    h4 G
    p 這邊是內文這邊是內文這邊是內文這邊是內文
              
            
!

CSS

              
                * 
  // border : solid 1px black
  vertical-align: top
  font-family: 微軟正黑體
  
.container
  font-size: 0px
  max-width: 1024px //最大寬度
  margin-left: auto
  margin-right: auto

.block
  display: inline-block
  font-size: 20px
  height: 200px
  border: solid 3px black
  box-sizing: border-box
  text-align: center
  padding: 10px
  p
    font-size: 15px
  .icon
    width: 30%
    min-width: 200px  //最小寬度
    
  
  h4
    text-align: center

.sblock
  border: solid 1px black
  display: inline-block
  width: 30%
  img
    width: 100%
    height: 200px
    background-color: #aaa
  
.intro
  height: initial
.a,.g,.intro
  width: 100%
.b
  width: 70%
.c,.f
  width: 30%
.d,.e
  width: 35%
  

@media screen and (max-width: 800px)
  .b
    width: 100%
  .c,.d,.e,.f
    width: 50%
  
@media screen and (max-width: 400px)
  .b.c,.d,.e,.f
    width: 100%
  .sblock
    display: block
    width: 100%
    margin-bottom: 10px
    
              
            
!

JS

              
                
              
            
!
999px

Console