cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


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.

              <div id="radios">
  <input type="radio" name="justifyItems" value="start" ><label> start </label> 
  <input type="radio" name="justifyItems" value="end"><label> end </label> 
  <input type="radio" name="justifyItems" value="center" checked><label> center </label>
  <input type="radio" name="justifyItems" value="stretch"><label> stretch </label><br>
  <input type="radio" name="alignItems" value="start" ><label> start </label> 
  <input type="radio" name="alignItems" value="end"><label> end </label> 
  <input type="radio" name="alignItems" value="center" checked><label> center </label>
  <input type="radio" name="alignItems" value="stretch"><label> stretch </label>

<div id="cuadricula">
<div class="item a"><p>a</p></div><!--header-->
<div class="item b"><p>b</p></div><!--left-->

              #cuadricula {
  display: grid;
  grid-template-columns: repeat(5, 100px);
  grid-template-rows: repeat(3, 100px);
  grid-template-areas: "a  a . .  ."
                       "a  a . b  b"
                       ".  . . b  b";
  /* justify-items: start | end | center | stretch; */
  justify-items: center;
  /* align-items: start | end | center | stretch; */
  align-items: center;
  margin: 0 auto;
  border: 1px dashed #777;
  width: 500px;
  background: 0 0/100px 100px linear-gradient(transparent 0%, transparent 99%, #777 100%), 0 0/100px 100px linear-gradient(90deg, transparent 0%, transparent 99%, #777 100%), 0 0/200px 200px no-repeat url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/222579/test.svg'), 300px 100px/200px 200px no-repeat url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/222579/test.svg');

.a {
  grid-area: a;

.b {
  grid-area: b;

.item {
  padding: 2em;
  border: 1px solid #000;
  border-radius: 10px;
  background-color: hsla(180, 100%, 50%, .5);
  color: white;
  display: grid;

.item p {
  justify-self: center;
  align-self: center;
  color: white;

/*unimportant stuff*/
body {
  font-family: Verdana, Geneva, sans-serif;
  line-height: 2em;
  background-color: #222;
  color: #777;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

#radios {
  width: 500px;
  margin: 1em auto;

#radios strong {
  display: inline-block;
  width: 130px;
              var radios = document.querySelector("#radios");
var grid = document.querySelector("#cuadricula");
  var val = evt.target.value;console.log(val)
  var prop = evt.target.name;console.log(prop)
  grid.style[prop] = val;
}, false);

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................