cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <html>
<head>
	<title>Star Wars Spoilers</title>
</head>
<body>
	<img src="http://lilianabrissos.com/img/projects/deathstar.png" />
	<p class="spoiler">
		<!--Spoiler:-->
		<span>Darth Vader is Luke Skywalker's Father! Noooooooooooo!</span>
	</p>
	<p class="spoiler">
		<!--Spoiler:-->
		<span>Luke and Leia are siblings. Ew.</span>
	</p>
	<script src="https://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/app.js" type="text/javascript" charset="utf-8"></script>
</body>
            
          
!
            
              body {
  background: #2f558e url(http://lilianabrissos.com/img/projects/bg.png) repeat 0 0;
  background-size: 400px auto;
  font-family: sans-serif;
}
img {
  display: block;
  width: 150px;
  margin: 100px auto;
}
button {
  background: #dae1e4;
  border: none;
  border-radius: 5px;
  color: #1d3c6a;
  font-size: 24px;
  width: 480px;
  padding: 40px 0;
  margin: -40px -20px;
  outline: none;
  cursor: pointer;
}
.spoiler {
	background: #1d3c6a;
  width: 440px;
  margin: 0 auto 20px;
  border-radius: 5px;
  padding: 40px 20px;
  text-align: center;
  font-size: 24px
}
.spoiler span {
  color: #dae1e4;
}
            
          
!
            
              //Prevent spoilerphobes from seeing spoilers
//Solution: Hide spoilers and reveal them through user interaction

//1, Hide spoiler
$(".spoiler span").hide();
//2, Add a button
$(".spoiler").append("<button>Reveal spoiler!</button>");
//3, When button pressed
$("button").click(function(){
	//3.1, Show spoiler next to the button clicked
	$(this).prev().show();
  //3.2, Get rid of button
  $(this).remove();
});

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console