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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<ul>
  <li><a href="javascript:void(0)" class="anc" data-tag="pos1">1</a></li>
  <li><a href="javascript:void(0)" class="anc" data-tag="pos2">2</a></li>
  <li><a href="javascript:void(0)" class="anc" data-tag="pos3">3</a></li>
</ul>

<div class="wrap">
<h3 class="open_h3 btn-7" id="pos1">BRAND INFO1</h3>
<p class="info open-7"></p>
<h3 class="open_h3 btn-7" id="pos2">BRAND INFO2</h3>
<p class="info open-7"></p>
<h3 class="open_h3 btn-7" id="pos3">BRAND INFO3</h3>
<p class="info open-7"></p>
</div>
              
            
!

CSS

              
                .wrap{
    width: 800px;
    padding: 10px 20px;
    border: 1px solid #000;
    margin-bottom: 800px;
}
h3.open_h3{
    border-bottom: 1px dotted #a9a9a9;
    cursor: pointer;
    margin: 0;
}
.open_h3:after, 
.open_h3.active:after {
    font-size: 22px;
    margin-left: 20px;
}
.open_h3.active::after {
    content: "▲";
}
.open_h3::after {
    content: "▼";
}
.info{
    font-size: 13px;
}



ul{
  margin-bottom: 300px;
  list-style: none;
  padding-left: 0;
  display: flex;
  justify-content: space-evenly;
}

ul li{
  width: calc((100%-30px) / 3);
  margin: 0 5px;
}

ul li a{
  width: 100%;
  padding: 5px 0;
  border: 1px solid #333;
  color: #333;
  display: block;
  text-decoration: none;
  text-align: center;
}
              
            
!

JS

              
                var text = '1917年に創業者のマリオ・プラダと兄弟によりインポートショップをオープン。世界中の素材や高品質な革を集め、イタリアの技術を投入したアイテムが有名に。1978年に孫娘のミウッチャ・プラダがオーナー兼デザイナーに就任。その後、マリオの使用していたナイロン地“ポコノ”に目を向け、レザーと併用したバッグが大ヒット。逆三角形のロゴプレートが一世を風靡したのは最近の記憶にも新しい。以来、PRADAはクリスマス時のシーズンアイテムや、上質なレザーを使用したSAFFIANOシリーズ等のブランドの代名詞と言われるアイテムを生み出した。近年では、映画への衣装提供・モバイル発売・車のデザイン等、服飾だけでなく様々な分野にも進出し、前進しつづけるブランド。';
$('.info').append(text);

$('.open-7').each(function(){
  $(this).css("height",$(this).height()+"px");
});
$('.open-7').hide();

$('.anc').click(function () {
  var tag = $(this).data('tag');
  if (!$('#'+tag).hasClass('active')){
    $('#'+tag).next('.open-7').slideToggle('slow');
    $('#'+tag).toggleClass('active');
  }
  
  var target = $('#'+tag);
  var position = target.offset().top;

  $('body,html').animate({scrollTop:position}, 400, 'swing');

  return false;
});

$('.btn-7').click(function () {
  $(this).next('.open-7').slideToggle('slow');
  $(this).toggleClass('active');
});
              
            
!
999px

Console