Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.


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.


	<div class="text">読み込み中…</div>


                section {
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 20px;
	margin: 10px auto 0;
	max-width: 300px;
	text-align: center;

h1 {
	font-size: 1.5rem;
	margin: 0 0 1rem;

.h2_elem {
	text-align: left;
	border: none;

h2 {
	font-size: 1.25rem;
	margin: 0 0 1rem;	

p {
	margin: 0 0 1rem;	
	line-height: 1.5;

ul {
	margin: 10px 0 0;
	font-size: 0.9em;

li {
	margin: 0 0 5px;

.form {
	margin: 0 0 1rem;


const text = document.querySelector('.text');

let goukei = 8376;

const h2Text = '割り勘(合計' + goukei + '円)';

const bgColor1 = {
	background: '#fcc',	
	padding: '10px',

const bgColor2 = {
	background: '#ccf',	
	padding: '10px',

const bgColor3 = {
	background: '#cfc',	
	padding: '10px',

function Warikan(props) {
	let tanka = goukei / props.number;
	return <p style={}>{props.number}名様では、お一人様あたり{tanka}円になります。</p>

let elm = (
	<section className="h2_elem">
		<h2>{ h2Text }</h2>
			<Warikan number="3" style={bgColor1} />
			<Warikan number="6" style={bgColor2} />
			<Warikan number="8" style={bgColor3} />

ReactDOM.render(elm, text);