Pen Settings



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


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.


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.


                <p>CSS-only Star Rating</p>
<h2>How excited are you for the new Avengers movie on a scale of 1-5 stars?</h2>
<div class="rating">
		<input type="radio" name="test" id="one" checked />
		<label for="one"><i class="fa fa-star"></i></label>
		<input type="radio" name="test" id="two" />
		<label for="two"><i class="fa fa-star"></i></label>
		<input type="radio" name="test" id="three" />
		<label for="three"><i class="fa fa-star"></i></label>
		<input type="radio" name="test" id="four" />
		<label for="four"><i class="fa fa-star"></i></label>
		<input type="radio" name="test" id="five" />
		<label for="five"><i class="fa fa-star"></i></label>
<p>The goal was to create a radio button-powered star rating widget that uses CSS only. I wanted each star preceding the selected one to appear selected as well.</p>


                @import "compass/css3";

$rad: 8px;

.rating {
	background: #fff;

input[type="radio"] {
	position: fixed;
	top: 0;
	right: 100%;

label {
	font-size: 1.5em;
	padding: 0.5em;
	margin: 0;
	float: left;
	cursor: pointer;
	@include transition(0.2s);

input[type="radio"]:checked ~ input + label {
	background: none;
	color: #aaa;

input + label {
	background: #fff;
	color: orange;
	margin: 0 0 1em 0;

input + label:first-of-type {
	border-top-left-radius: $rad;
	border-bottom-left-radius: $rad;

input:checked + label {
	border-top-right-radius: $rad;
	border-bottom-right-radius: $rad;

hr {
	clear: both;
	border: 0;
	border-top: 2px solid #999;
	margin: 2em 0;

/* ----- DEMO STUFF ----- */
body {
	padding: 5% 10%;
	line-height: 1.4;
	background: #888;
	color: #fff;
	font-family: sans-serif;