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.


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.


                <!-- cet id "hello" est géré avec javascript ET CSS -->
<p id="hello">HELLO ALL!</p>

<!-- cet id "rdm" est géré avec javascript ET CSS -->
<p id="rdm">RANDOM!</p>

<!-- cet id "unmot" est géré avec javascript ET CSS -->
<p id="unmot">un mot</p>


                p {
	width: 600px;
	color: crimson;
	padding: 20px;
	font-family: helvetica;
	font-size: 24px;

#hello {
	font-family: helvetica;
	font-weight: 900;
	color: white;
	padding: 50px;
	text-align: center;

#rdm {
	font-family: 'Baloo', cursive;
	color: blueviolet;

#unmot {
	color: black;


                var c;
var a;

var toto;
var dog;

var rdm;

//la variable unmot
var unmot;

function setup() {
	var myDiv;
	myDiv = createDiv('Cette balise div est créée en javascript avec la fonction createDiv');

	createP("Voici un nombre choisi au hasard entre 0 et 10 : " + random(10)); //le style de ce texte se trouve dans le CSS avec p
	c = select('#hello'); //ici on selectionne le paragraphe avec l'id #hello
	a = select('#hello');
	toto = random(10,68);
	dog = color(random(255));
	rdm = select('#rdm');
	unmot = select('#unmot');//la variable unmot est assignée avec l'id #unmot'font-size', '90px');//la font size est déterminée en javascript avec la fonction style

function draw() {'font-size', toto + 'px'); //la taille de la font de l'id #hello est en random entre 10 et 68px'background-color', dog); //la couleur de fond du paragraphe avec l'id #hello est en random entre 0 et 255 nuances de gris'font-size', mouseX + 'px');