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.


                <h1>CSS :focus-visible</h1>
<p>illustration de <code>:focus-visible</code> lors d'un clic, d'un touch et d'une navigation clavier (tabulation)
<div class="box">
  <button class="custom-button">clique, touche, tabule-moi !</button>

<div class="box">
  <button class="burger-button" type="button" role="button" aria-label="open/close navigation"><i></i></button>
<div class="temp">boîte de contenu dont la couleur de fond change lors du clic/touch/tab sur le bouton burger</div>


.custom-button:focus {
  background: beige;

@supports selector(div:focus-visible) {
  /* only on clic/tap focus */
  .custom-button:focus:not(:focus-visible) {
    outline: 0;
  /* only on keyboard focus */
  .custom-button:focus-visible {
    outline: 6px dashed hotpink;

/* deco */
body {
  min-height: 100vh;
  display: grid;
  place-content: center;
  place-items: center;
  row-gap: 1rem;

h1, p {
  margin: 0;

.custom-button {
  all: unset;
  padding: 1rem;
  border: 2px solid pink;
  cursor: pointer;

/* Burger button styles */
:root {
  --burger-button-size: 1.8rem;
  --burger-button-thickness: 6px;
  --burger-button-color: purple;

.burger-button {
  appearance: none;
  all: unset;
  display: inline-grid;
  grid-template-rows: repeat(3, var(--burger-button-thickness));
  align-content: space-between;
  vertical-align: top;
  height: var(--burger-button-size);
  width: var(--burger-button-size);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
.burger-button::before {
  content: "";
  background: var(--burger-button-color);
.burger-button:focus-visible {
  /* affichage du focus lors de la navigation au clavier */
  outline: 2px dashed var(--burger-button-color);
  outline-offset: 5px;

.temp {
  padding: 1rem;
  background: powderblue;
} {
  background: bisque;


                (function() {
function toggleTemp() {
// Define targets
var target = document.querySelector('.temp');
var button = document.querySelector('.burger-button');

// click-touch event
if ( button ) {
  function (e) { 
  }, false );
} // end toggleTemp()