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

              
                <script type="text/javascript" src="http://www.webdesignerwall.com/demo/jquery/jquery.js"></script>
<div class="accordion">
	
	<h3>Crafty Camping</h3>
  <p>Staying With Us<br /><br />

  We call it Crafty Camping <br /><br />

Stay with us and our cosy bell tents and beautiful yurts, tipi and shepherds hut can be your home-from-home.<br /><br />
  You don't have to attend a course to enjoy our wonderful 'glamping' facilities, which include woodland showers, a sauna yurt and a communal yurt with games and craft library, while the 'Out of Africa' kitchen and pizza oven further help ensure a restful holiday with a difference.<br /><br />

We offer a peaceful woodland setting in Dorset, near to the Jurassic Coast 'World Heritage Site' and perfect for a short break or longer holiday. We're close to Devon and Somerset too - so we make a great base for exploring all three counties.<br /><br />
    See "Dome Sweet Dome" below
  </p>
  <h3>Dome Sweet Dome</h3>
	<p><img src="http://www.protorials.com/wp-content/uploads/2014/08/home_med.jpg"</img</p>
	<h3>Hobbiton</h3>
	<p>Hobbiton is a fictional village which appeared in the novels: “The Lord of the Rings” and “The Hobbit” by by J.R.R. Tolkien. Hobbiton village was built as a set (for the films which were based on the Novels) is located on a farm near a little town called Matamata in northern New Zeland<br /><br />
    See "Hobbit Home" below
  </p>
	<h3>Hobbit Home</h3>
	<p><img src="https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xfa1/t1.0-9/10411315_832450980106021_865525337091628577_n.jpg"></p>
	
  <h3>Natural Pools</h3>
	<p>Hamilton Pool Preserve is a natural pool that was created when the dome of an underground river collapsed due to massive erosion thousands of years ago. The pool is located about 23 miles (37 km) west of Austin, Texas off Highway 71. Since the 1960s, Hamilton Pool has been a popular summer swimming spot for Austin visitors and residents.<br /><br />
  See "Hamilton Pool Preserve" below
  </p>
   <h3>Hamilton Pool Preserve</h3>
  <p><img src="https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-xaf1/t1.0-9/10421170_827811953903257_3948301641934611135_n.jpg"</img></p>
</div>

              
            
!

CSS

              
                body {
	margin: 2% auto;
	width: 96%;
	font: 75%/120% Arial, Helvetica, sans-serif;
}
img {
  width: 100%;
}
.accordion {
	width: 100%;
	border-bottom: solid 1px #c4c4c4;
}
.accordion h3 {
	background: #e9e7e7 url(http://www.protorials.com/wp-content/uploads/2014/08/arrow-square.gif) no-repeat right -51px;
	padding: 10px 15px;
	margin: 0;
	font: bold 120%/100% Arial, Helvetica, sans-serif;
	border: solid 1px #c4c4c4;
	border-bottom: none;
}
.accordion h3:hover {
	background-color: #e3e2e2;
}
.accordion h3.active {
	background-position: right 5px;
}
.accordion p {
	background: #f7f7f7;
	margin: 0;
	padding: 10px 15px 20px;
	border-left: solid 1px #c4c4c4;
	border-right: solid 1px #c4c4c4;
}
              
            
!

JS

              
                $(document).ready(function(){
	
	$(".accordion h3:first").addClass("active");
	$(".accordion p:not(:first)").hide();
	$(".accordion h3").click(function(){
		$(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});

});
              
            
!
999px

Console