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 class="layout-maxed">
  <h2>layout-maxed et full-bleed</h2>

  <p>.layout-maxed<br />Le comportement .layout-maxed est celui-ci :</p>
  <ul>
    <li>Le parent (ici body) a une largeur maximum et est centré dans la fenêtre</li>
    <li>Sur très petit écran, une marge de côté est toujours présente afin que le parent ne soit pas collé aux bords de fenêtre</li>
  </ul>
  <p>Le principe est de déclarer une grille de 3 colonnes où tout le contenu sera placé dans la colonne centrale.</p>

  <div class="full-bleed">
    <p>.full-bleed<br />La couleur de fond du bloc .full-bleed doit s'étendre sur toute la surface du viewport, ni plus ni moins. Son contenu doit se placer au même niveau que le contenu général.<br>
      Un élément .full-bleed se place naturellement comme un enfant direct d'un .layout-maxed.
    </p>
  </div>

  <p>Noch bredele schissabibala, yeuh e schmutz. E gewurtztraminer doch Carola schneck, schmutz a riesling de chambon eme rucksack Roger dû hopla geiss, jetz Chorchette de Scharrarbergheim. Kouglopf ech ìch wurscht gueut mitt schneck jetz a schiss mannele, knèkes saucisse de Niederhausbergen of fill mauls schéni fleischwurcht schnaps de eme gal nüdle blottkopf, de Chulien Roger hop pfourtz! bett mer ech schpeck un salami schmutz. Gal!</p>

  <img class="hero-img" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9425/brit.jpg" alt="oops">
  
  <p>Source : <a href="https://mastery.games/post/article-grid-layout/">https://mastery.games/post/article-grid-layout/</a></p>
  
  <p>Lorem Elsass Ipsum mitt picon bière munster du ftomi! Ponchour bisame. Bibbeleskaas jetz rossbolla sech choucroute un schwanz geburtstàg, Chinette dû, ìch bier deppfele schiesser. Flammekueche de knèkes Seppele gal! a hopla geburtstàg, alles fraü Chulia Roberts oder knäckes dûû blottkopf.</p>

</body>
              
            
!

CSS

              
                :root {
  --spacer-small: 2rem;
}

/* This layout is pure magic!! */
.layout-maxed {
  --layout-size: 40rem;
  display: grid;
  grid-template-columns:
   [layout-start] minmax(var(--spacer-small), 1fr)
   [content-start] minmax(auto, var(--layout-size)) [content-end]
   minmax(var(--spacer-small), 1fr) [layout-end];
}

/* Center all children */
.layout-maxed > * {
  grid-column: content;
}

/* Full bleed box */
.full-bleed {
  display: grid;
  grid-template-columns: inherit;
  grid-column: layout;
}
.full-bleed > * {
  grid-column: content;
}

/* Hero image */
.hero-img {
  grid-column: layout;
  justify-self: center;
  max-width: 100%;
}

/* Reset / Deco */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 1.2rem;
  line-height: 1.5;
}

ul {
  padding-left: 1em;
}

p {
  margin: 0;
}

.full-bleed {
  padding-block: 1rem;
  background: #333;
  color: #fff;
}
              
            
!

JS

              
                
              
            
!
999px

Console