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

+ 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.


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.


                <!doctype html>
<html ⚡>
  <meta charset="utf-8">
  <script async src=""></script>
  <!-- ## Setup -->
  <!-- Import the amp-lightbox component in the header -->
  <script async custom-element="amp-lightbox" src=""></script>
<script async custom-element="amp-form" src=""></script>  
  <link rel="canonical" href="">
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
  <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
  <style amp-custom>
   .lightbox {
      background: rgba(0,0,0,0.8);
      width: 100%;
      height: 100%;
      position: absolute;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
    .lightbox h1 {
      color: white;

position: relative;  
max-width: 300px;
.search-content h4{
font-size: 20px;
margin-top: 0;

position: absolute;
right: 0;
background: transparent;
border: 0;
color: #fff;
font-size: 25px;
text-align: center;
width: 40px;
height: 40px;
background-color: rgba(0,0,0,0.3);
padding: 2px 10px;
margin-top: 5px;
margin-bottom: 5px;
background-image: none;
border: 1px solid #fff;
border-radius: 4px;  
color: #fff;

  <!-- 開啟視窗1-點擊後關閉視窗 -->
  <amp-lightbox id="my-lightbox" layout="nodisplay">
    <div class="lightbox" on="tap:my-lightbox.close" role="button" tabindex="0">
      <h1>Hello World!</h1>
 <!-- 開啟視窗2-內有搜尋欄位 -->
 <amp-lightbox id="search-lightbox"
  <div class="lightbox"
    <div class="search-content">
    <div class="search-title"> <button on="tap:search-lightbox.close" class="search-close">X</i></button>
    <h4 class="modal-title text-center">搜尋</h4></div>
         <form method="GET"
  <div id="search" class="ampstart-input inline-block relative mb3">
    <input type="hidden" name="module" value="product"><input type="hidden" name="mn" value=""><input type="hidden" name="f" value="search">       
    <input name="k" type="text" class="search_textfield" value="" /> 
   <input name="button" type="submit" class="search_bt" id="button" value="搜尋" />

  <!-- 按鈕1 -->
  <button class="ampstart-btn" on="tap:my-lightbox" role="button" tabindex="0">
 <!-- 按鈕2 -->
  <button class="ampstart-btn" on="tap:search-lightbox" role="button" tabindex="0">