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

              
                <body>
  <div id="a-supprimer" class="alert alert-danger m-4">
    Ceci est un élément à supprimer grâce à JavaScript.
  </div>
  </script>
</body>
              
            
!

CSS

              
                
              
            
!

JS

              
                // Supprimer le div avec l'id #a-supprimer
const divAsupprimer = document.querySelector("#a-supprimer").remove();

// Créer un header
const header = document.createElement("header");
document.body.append(header);

// Créer un sous-header
const main = document.createElement("main");
document.body.append(main);

const ul = document.createElement("ul");
main.append(ul);

const li = document.createElement("li");
ul.append(li);

const h1 = document.createElement("h1");
header.append(h1);

// Créer un conteneur pour l'image et le titre
const imgContainer = document.createElement("div");
document.body.append(imgContainer);

const imgLili = document.createElement("img");
imgLili.src = "https://imagizer.imageshack.com/img922/4823/LbNw9L.jpg";
imgContainer.append(imgLili);

const h2 = document.createElement("h2");
h2.textContent = "Biography of Li Li";
imgContainer.append(h2);

// Créer un paragraphe
const paragraphe = document.createElement("p");
document.body.append(paragraphe);

// styles
document.body.style.fontFamily = "Arial";

h1.textContent = "Blizzard Games 🚀";
h1.style.fontFamily = "Hack";
h1.style.textAlign = "center";
h1.style.color = "#fff";

h2.style.marginTop = "1rem";

header.style.backgroundColor = "#444554";
header.style.padding = "3rem";
header.style.borderRadius = "5px";

main.style.backgroundColor = "#F31559";
main.style.borderRadius = "5px";

ul.style.display = "flex";
ul.style.padding = "2rem";
ul.style.listStyle = "none";
ul.style.color = "#fff";
ul.style.fontWeight = "bold";
ul.style.fontSize = "1.1rem";
li.textContent = " Li Li 🌸 ";

paragraphe.textContent =
  "Born upon Shen-zin Su, the Wandering Isle, Li Li Stormstout led a somewhat uneventful life until she began reading the journals of her uncle Chen. Soon, nothing would sate her desire for adventure, exploration, and pestering adventurers around Halfhill. ";

paragraphe.style.marginLeft = "0.9rem";
imgContainer.style.marginLeft = "0.9rem";
imgContainer.style.cursor = "pointer";

paragraphe.style.maxWidth = "350px";

              
            
!
999px

Console