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

              
                
<html ⚡>

<head>
    <meta charset="utf-8">
  <title>Tab Panels with amp-selector</title>
    <link rel="canonical" href="https://ampbyexample.com/advanced/tab_panels_with_amp-selector/">
<link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css' rel='stylesheet'/>
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <script async src="https://cdn.ampproject.org/v0.js"></script>
    <!-- #### Setup -->
    <!-- Import `amp-selector` component in the header which we'll use to implement the tab switching. -->
    <script async custom-element="amp-selector" src="https://cdn.ampproject.org/v0/amp-selector-0.1.js"></script>
    <!-- Import `amp-carousel` component in the header which we'll use as a sample tab content -->
    <script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
    <!-- Import `amp-bind` component in the header which we'll use to switch tabs via buttons -->
    <script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script>
    <!-- amp-ifram optional -->
  <script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
    <style amp-custom>       

    </style>
    <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>
</head>
<body>
  <div id="amp-blogger">
  <div id="header">
    <h1>AMP-SELECTOR BLOGGER</h1></br>
    <p>Add Multi Tab with amp-selector</div>
  <div id="menu"></div>

  <div id="content">
      <!-- TAB START HERE-->
    <amp-selector role="tablist" layout="container" class="ampTabContainer">
      <!-- TAB One -->
        <div role="tab" class="tabButton" selected option="a">Tab one</div>
        <div role="tabpanel" class="tabContent">
          <!-- CONTENT WIDGET // 1 START -->
      <a href='#'><amp-img src='https://2.bp.blogspot.com/-jxqVaxnZksY/WjiaVlcj5jI/AAAAAAAAEmM/syvGwZsOTtAhvMnk4ZgnI_03uV9nJDtAQCLcBGAs/s1600/mount-icon.png' alt='Gunung' width='273' height='82' layout='responsive'></amp-img></a>
          <a href='#'>
<amp-img src='https://1.bp.blogspot.com/-e7y2gpKJba0/WjiaVtu_LbI/AAAAAAAAEmI/XQneKtP7nF07mrxhaQHD9pNIUI2sXBvOQCLcBGAs/s1600/pantai-icon.png' alt='Gunung' width='273' height='82' layout='responsive'></amp-img>
</a>
          <a href='#'>
<amp-img src='https://4.bp.blogspot.com/-XfD37GwNKN0/WjiaVzfHrAI/AAAAAAAAEmQ/lMdFcBkSMbMqJBkD7mbvoTUIYSXfiTl5gCLcBGAs/s1600/wisata-alam.png' alt='Gunung' width='273' height='82' layout='responsive'></amp-img></a>
          <!-- CONTENT WIDGET // 1 END -->
      </div>
      <!-- TAB two -->
        <div role="tab" class="tabButton" option="b">Tab two</div>
        <div role="tabpanel" class="tabContent">
          <!-- CONTENT WIDGET // 2 START -->
          <div class='disqus-comments' id='disqus_comments'>
<amp-iframe frameborder='0' height='300' layout='responsive' resizable='resizable' sandbox='allow-forms allow-scripts allow-same-origin allow-modals allow-popups' scrolling='yes' src='https://cdn.rawgit.com/KompiAjaib/kompi-html/master/amp_html_disqus.html?shortname=amp-project-for-blogger&fontBodyFamily=sans-serif&fontLinkColor=e8554e&url=https://www.amp-blogger.com/2018/06/material-design-font-awesome.html' width='600'>
<div aria-label='Disqus Comments' overflow='' role='button' tabindex='0'>Disqus Comments</div>
</amp-iframe>
</div>
          <!-- CONTENT WIDGET // 2 END -->
      </div>
      <!-- TAB three -->
        <div role="tab" class="tabButton" option="c">Tab three</div>
        <div role="tabpanel" class="tabContent">
          <!-- CONTENT WIDGET // 3 START -->
          <div class='authorboxwrap'>
<div class='authorboxfull'>
<div class='avatar-container'>
<amp-img alt='Hafid Maulana' height='90px' layout='fixed' src='//lh3.googleusercontent.com/-OrKzRvtNzZ0/AAAAAAAAAAI/AAAAAAAAD-4/QT7VPmlLiWg/s512-c/photo.jpg' width='90px'></amp-img>
</div>
<div class='author_description_container'>
<h4>AMP-BLOGGER</h4>
<p>
Thanks for visit. Please rate and give comment below.
</p>
<div class='social-links'>
<li><a class='external external-link' href='https://facebook.com' rel='nofollow' target='_blank'><i class='fa fa-facebook'></i></a></li>
<li><a class='external external-link' href='https://plus.google.com' rel='nofollow' target='_blank'><i class='fa fa-google-plus-square'></i></a></li>
<div class='clear'></div>
</div>
</div>
</div>
</div>
          <!-- CONTENT WIDGET // 3 END -->
      
      </div>
    </amp-selector>
    <!-- TAB END HERE-->
  </div>
 <div class="infoter">
<h6>Copyright © <span id="current-year">2018</span>
<a href="//www.amp-blogger.com/" itemprop="creator" itemscope="itemscope" itemtype="http://schema.org/Person"><span itemprop="name">AMP BLOGGER</span></a> - Made with <svg class="va-middle" height="14" viewBox="0 0 24 24" width="14">
<path d="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z" fill="#e84393"></path>
</svg> by <a href="#" rel="license">hafidm93</a> | Layout by Arlina Design</h6>
<br>
<p>Powered by <a href="//www.amp-blogger.com/" target="_blank" title="Idntheme">AMP Project for Blogger</a>
</div>
</div>

<div class='back-to-top' id='back-to-top' title='Back to top'><i class='fa fa-chevron-up' /></div>

    </div>

</body>

</html>
              
            
!

CSS

              
                /*AMP TAB SELECTOR */
.ampTabContainer{display:flex;flex-wrap:wrap;margin:0;padding:5px;border-style:none}
.tabButton[selected]{outline:0;background:#19B5FE;border-style:none;border-radius:5px}

.tabButton{background:#fff;display:table-cell;width:31%;color:#000;padding:10px;font-size:14px;text-align:center;cursor:pointer;font-weight:700;border-top:1px solid rgba(0,0,0,.05);border-bottom:1px solid rgba(0,0,0,.05);border-left:1px solid rgba(0,0,0,.05);transition:all .3s}

.tabContent{display:none;width:100%;order:1}

.tabButton[selected]+.tabContent{display:block;outline:0}

.itemCustom{border:1px solid #000;height:280px;width:380px;margin:10px;text-align:center;padding-top:140px}
amp-selector [option][selected]{cursor:auto;outline:none;}

/*AMP TAB SELECTOR END*/


@import url(https://fonts.googleapis.com/css?family=Quicksand);
body {
  margin: 0;
  padding: 0;
  background: #e6e6e6;
  font-family: Quicksand, sans-serif;
}

#amp-blogger {
  margin: 5% auto;
  width: 100%;
  max-width: 920px;
  box-shadow: 0 0 0 20px rgba(0,0,0,0.03);
}

#header {
  height: 200px;
  margin: 0;
  background: #fdfdfd;
}

#header h1 {
  display: table;
  color: #999;
  font-weight: 400;
  text-align: center;
  margin: auto;
  padding: 50px 50px 0 50px;
  font-size: 55px;
}

#header p {
  display: table;
  color: #999;
  font-weight: 400;
  text-align: center;
  margin: auto;
  padding: 10px;
  font-size: 20px;
}

#menu {
  position: relative;
  height: 60px;
  margin: 0;
  background: #444;
}

#menu:before {
  position: absolute;
  content: '';
  display: inline-block;
  left: 0;
  top: 0;
  height: 60px;
  width: 80px;
  margin: 0;
  text-align: center;
  background: #fc4f3f;
}

#menu:after {
  position: absolute;
  content: '\f015';
  display: inline-block;
  font-family: FontAwesome;
  left: 0;
  top: 0;
  height: 60px;
  line-height: 60px;
  width: 80px;
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 20px;
}

#content {
  position: relative;
  width: 100%;
  height: 1850px;
  margin: 0;
  background: #fff;
  padding: 20px 0;
}

#main {
  position: relative;
  float: left;
  width: 70%;
  background: #fff;
}

#box {
  position: relative;
  width: 93.5%;
  height: 150px;
  display: block;
  background: #f6f6f6;
  margin: 0 20px 20px 20px;
}

#box:before {
  position: absolute;
  content: '';
  display: inline-block;
  left: 0;
  top: 0;
  height: 150px;
  width: 200px;
  margin: 0;
  background: #e6e6e6;
}

#box:after {
  position: absolute;
  content: '\f1cb';
  font-family: FontAwesome;
  display: inline-block;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  height: 150px;
  line-height: 150px;
  width: 200px;
  margin: 0;
  color: #bbb;
  font-size: 50px;
}

#side {
  background: #fff;
  width: 30%;
  float: right;
  position: relative;
  margin: 0;
  padding: 0;
}

#sidecontent {
  width: 255px;
  height: 200px;
  margin: auto;
  background: #fc4f3f;
  position: absolute;
}

#sidecontent span {
  display: table;
  color: #fff;
  text-align: center;
  margin: auto;
  padding: 20px 0;
  font-size: 25px;
}

#sidecontent2 {
  width: 255px;
  height: 200px;
  margin: 0 20px 20px auto;
  background: #999;
  position: relative;
}

#sidecontent2 span {
  display: table;
  color: #fff;
  text-align: center;
  margin: auto;
  padding: 20px 0;
  font-size: 25px;
}

#footer {
  height: 200px;
  clear: both;
  background: #444;
}

#credit {
  height: 60px;
  margin: 0;
  background: #fff;
}

#credit span {
  display: table;
  color: #999;
  text-align: center;
  font-size: 20px;
  line-height: 60px;
  margin: auto;
}

.cf:before,
.cf:after {
  content: " ";
  display: table;
}

.cf:after {
  clear: both;
}

#sidecontent.fixed {
  position: fixed;
  top: 20px;
}
/* Back to top */

.back-to-top {
  visibility: hidden;
  background-color: #444;
  width: 50px;
  height: 50px;
  text-align: center;
  line-height: 48px;
  position: fixed;
  bottom: 65px;
  right: 35px;
  z-index: 90;
  cursor: pointer;
  border-radius: 1px;
  opacity: 0;
  -webkit-transform: translateZ(0);
  transition: all .6s
}

.back-to-top .fa {
  font-size: 18px;
  color: #fff;
  vertical-align: middle;
}

.back-to-top:hover {
  background-color: #fc4f3f;
  opacity: 1
}

.back-to-top.show {
  visibility: visible;
  bottom: 35px;
  opacity: 1;
}


/* COPYRIGHT */ 
.infoter h6,.infoter p{text-align:center;margin:auto;color:#fff}.infoter{max-width:100vw;background:#34495e;padding:10px 0}.infoter p{font-size:10px}.infoter h6{font-size:12px}.fixed-container,.fixed-height-container img{background-color:#ccc}.contain img{object-fit:contain}.cover img{object-fit:cover}.fixed-container{position:relative;width:200px;height:200px}.fixed-height-container{position:relative;width:100%;height:300px}}

/* CSS Multi Author Box */
.authorboxwrap{color:#000;margin:20px auto 0 auto;padding:20px;overflow:hidden;border-bottom:1px dotted rgba(0,0,0,0.1);border-top:1px dotted rgba(0,0,0,0.1)}
.avatar-container{background:#f5f5f5;float:left;padding:10px;margin:0 20px 0 0;border-radius:99em}
.avatar-container img{width:90px;height:auto;max-width:100%;border-radius:99em;transition:all .3s}
.author_description_container h4{font-size:18px;display:block;margin:0;margin-bottom:2px}
.author_description_container h4 a{color:#000}
.author_description_container p{margin:0;font-size:14px;margin-bottom:8px;line-height:25px;font-weight:400}
.social-links li{list-style:none;float:left}
.social-links a{border-bottom:none}
.social-links a:after,.social-links a:before{content:none}
.social-links li a{color:#fff;font-size:12px;text-align:center;display:inline-block;padding:0;margin:0 10px 0 0;width:24px;height:24px;line-height:24px;border-radius:3px}
.social-links li:nth-child(1) a{background:#516ca4;}
.social-links li:nth-child(2) a{background:#00c3f3;}
.social-links li:nth-child(3) a{background:#f20000;}

              
            
!

JS

              
                
              
            
!
999px

Console